(function () {
    "use strict";
    var e = window.jQuery,
		t = window.qh360cp;
    t.pages = t.pages || {}, t.pages.countdown = function (n, r, i) {
        i = i || t.pages.get_endtime_rule, r ? t.pages.countdown_sale = t.countdown.start({
            end_time: t.pages.endtime,
            sid: ".countdown",
            style: e(".countdown").attr("countdownstyle"),
            end_style: "",
            freq: 3e4,
            every_callback: i,
            filter: function (e) {
                return e.replace(/^(<b>0+<\/b>[^<]*)+/g, "")
            },
            callback: function () {
                t.pages.is_sale !== "1" && (e(".label-important").addClass("bg-ccc").text("\u7b49\u5f85\u5f00\u5956"), e(".countdown_tag").html("\u7b49\u5f85\u5f00\u5956\uff1a"), e("#post_data").find("span").addClass("btn-large2-dis").text("\u7b49\u5f85\u5f00\u5956")), t.pages.is_end = 1, t.pages.countdown_wait_open = t.countdown.start({
                    end_time: t.pages.endtime * 1 + t.pages.open_time * 1,
                    sid: ".countdown",
                    style: e(".countdown").attr("countdownstyle"),
                    end_style: "",
                    freq: 3e4,
                    filter: function (e) {
                        return e.replace(/^(<b>0+<\/b>[^<]*)+/g, "")
                    },
                    callback: function () {
                        e(".countdown_tag").html('<em class="red">\u6b63\u5728\u83b7\u53d6\u65b0\u671f\u6b21</em>'), e.isFunction(n) && n.call(this)
                    }
                }), t.pages.get_my_helper && t.pages.get_my_helper()
            }
        }) : t.pages.countdown_sale = t.countdown.start({
            end_time: t.pages.endtime,
            sid: ".countdown",
            style: e(".countdown").attr("countdownstyle") || "<b>DD</b>\u5929<b>hh</b>\u5c0f\u65f6<b>mm</b>\u5206<b>ss</b>\u79d2",
            end_style: "",
            filter: function (e) {
                return e.replace(/^(<b>0+<\/b>[^<]*)+/g, "")
            },
            every_callback: i,
            callback: function () {
                e.isFunction(n) ? n.call(this) : (t.pages.is_end = 1, t.pages.is_sale !== "1" && (e(".label-important").addClass("bg-ccc").text("\u5df2\u622a\u6b62"), e(".countdown_tag").html('<em class="red">\u5df2\u622a\u6b62</em>'), e("#post_data").find("span").addClass("btn-large2-dis").text("\u7b49\u5f85\u5f00\u5956")))
            }
        })
    }, t.pages.get_endtime_rule = function (e) {
        t.pages.lott_type_id == t.lottery.lott_type_id.sscjx && (e == 42e4 || e == 3e5 || e == 6e4) && t.pages.get_endtime()
    }, t.pages.get_endtime = function () {
        t.pages.get_issue_curr(function (e) {
            t.pages.endtime = e.FsEndTime, t.pages.countdown_sale.end_time = e.FsEndTime * 1e3, t.countdown.server_time = t.pages.countdown_sale.server_time_count
        }, function (e) {
            return e.FsEndTime != t.pages.endtime
        }, 4, 2e3)
    }
})();
(function () {
    "use strict";
    var e = window.jQuery,
		t = window.qh360cp;
    t.pages.init = function () {
        t.pages.price = t.lottery.price, t.pages.sel_act = "btn-boll-active", t.pages.modi = {}, t.pages.pages_path = "/" + window.location.pathname.split("/")[1], e.extend(t.pages, window.lott_info), t.pages.favcode()
    }, t.pages.get_plays = function () {
        var t = e(".mod-select-filter:visible input:checked"),
			n = t.val();
        if (!t.length) {
            var r = e("#plays .active");
            n = r.attr("desc") + "|" + (r.attr("playtext") || r.find("a").text())
        }
        return (n || "|").split("|")
    }, t.pages.get_plays_box = function () {
        return e("#plays .active").attr("desc")
    }, t.pages.get_plays_attr = function (t) {
        return e("#plays .active").attr(t) || !1
    }, t.pages.plays = function (n) {
        t.ui.tab({
            control: "#plays li",
            content: ".plays",
            prevent_default: 0,
            default_selected: n || 0,
            current_class: "active",
            callback: function (n, r) {
                e(r).attr("isshowplaybar") ? e(".zx_plays").hide() : e(".zx_plays").eq(n).show().siblings(".zx_plays").hide();
                var i = t.pages.get_plays(),
					s = (i[2] == "\u80c6\u62d6" ? "dt" : "zx") + "_" + i[0];
                e("#confirm_sel_code .r").text(t.pages.modi[s] ? "\u786e\u8ba4\u4fee\u6539" : "\u786e\u8ba4\u9009\u53f7");
                var o = e("#plays li").eq(n);
                i[0] == "R5" && i[2] != "\u80c6\u62d6" && i[3] != "\u80c6\u62d6" && t.pages.lott_type_id == t.lottery.lott_type_id.syxwsd ? e("#zn_filter").show() : e("#zn_filter").hide(), o.attr("codetips") && e(".ds_code_tips").html(o.attr("codetips")), o.attr("jjtips") && e(".showjj").html(o.attr("jjtips")), t.pages.palys_callback && t.pages.palys_callback.call(null, n, r);
                var u = e("#yilou_play_list");
                u.length && e(r).attr("combo") != "false" ? u.siblings(".list").find("li[val=" + i[0] + "]").trigger("click") : t.pages.update_yilou && t.pages.update_yilou(), _.include([t.lottery.lott_type_id.sscjx, t.lottery.lott_type_id.ssccq], t.pages.lott_type_id) && (t.pages.zst_type = t.pages.play_to_type[i[0]], t.pages.get_zst && t.pages.get_zst("0"))
            }
        })
    }, t.pages.get_lott_data = function (n, r, i, s, o, u, a, f) {
        var l = "get_lott_data_times_" + (n || ""),
			c = l + "_time",
			h = l + "_freq";
        o = o || 1e3, u = u || 30, a = a || 120, f = f || 99999, i = e.isFunction(i) ? i : e.noop, t.pages[l] = t.pages[l] || 1, t.pages[l] == 1 && (t.pages[c] = +(new Date), t.pages[h] = o);
        var p = new Date - t.pages[c];
        if (p > a * 1e3) {
            t.pages[l] = 1, o = t.pages[h];
            return
        }
        if (t.pages[l] > f) {
            t.pages[l] = 1, o = t.pages[h];
            return
        }
        var d = Math.floor(p / 1e3 / u),
			v = 2;
        Math.pow(v, d) * t.pages[h] > o && (o *= v), e.ajax({
            url: r,
            data: {
                t: +(new Date)
            },
            dataType: "json"
        }).done(function (e) {
            i(e) ? (t.pages[l] = 1, o = t.pages[h], s.call(null, e)) : (t.pages[l]++, setTimeout(function () {
                t.pages.get_lott_data(n, r, i, s, o, u, a, f)
            }, o))
        }).fail(function () {
            t.pages[l]++, setTimeout(function () {
                t.pages.get_lott_data(n, r, i, s, o, u, a, f)
            }, o)
        })
    }, t.pages.get_issue_curr = function (e, n, r, i) {
        n = n ||
		function (e) {
		    return e.Issue != t.pages.issue
		};
        var s = "curr_issue_" + t.pages.issue,
			o = "/int/qcurissue?LotID=" + t.pages.lott_type_id;
        i = i || 2e3, t.pages.get_lott_data(s, o, n, e, i, "", r)
    }, t.pages.get_open_code = function () {
        var n = t.pages.issue_pre || t.pages.issue.substring(0, 4) + e("#open_issue").text(),
			r = "open_code_" + n,
			i = "/i/lotapi.html?datatype=json&do=qkjcode&lotID=" + t.pages.lott_type_id + "&issue=" + n;
        t.pages.get_lott_data(r, i, function (e) {
            return e[0] && e[0].code || ""
        }, t.pages.get_open_code_callback, 3e3)
    }, t.pages.get_yilou = function (n) {
        var r = "/i/lotapi.html?do=qTopLotStat&lotID=" + t.pages.lott_type_id + (n ? "&" + n : ""),
			i = t.pages.issue_pre || e("#open_issue").text(),
			s = function (e) {
			    return n ? e && e.LotIssue : typeof e == "object" && e.LotIssue == i
			};
        t.pages.get_lott_data("syxwsd_yl_" + i, r, s, t.pages.save_yilou)
    }, t.pages.get_zst = function (n) {
        var r = e(".period-tab .active").attr("val"),
			i = {};
        i[t.lottery.lott_type_id.syxwsd] = "/yun11", i[t.lottery.lott_type_id.syxwgd] = "/gd11", i[t.lottery.lott_type_id.syxwjx] = "/dlcjx", i[t.lottery.lott_type_id.syxwhlj] = "/hlj11", i[t.lottery.lott_type_id.syxwln] = "/ln11", i[t.lottery.lott_type_id.syxwsh] = "/sh11", i[t.lottery.lott_type_id.syxwxj] = "/xj11", i[t.lottery.lott_type_id.syxwcq] = "/cq11", i[t.lottery.lott_type_id.ssccq] = "/ssccq", i[t.lottery.lott_type_id.sscjx] = "/sscjx", i[t.lottery.lott_type_id.k3gx] = "/k3gx", i[t.lottery.lott_type_id.k3jl] = "/k3jl", i[t.lottery.lott_type_id.k3js] = "/k3js", i[t.lottery.lott_type_id.k3nm] = "/k3nm", i[t.lottery.lott_type_id.k3hb] = "/k3hb";
        var s = function (e) {
            return e && e.html
        };
        e("#mini-zst").addClass("nonum");
        var o = function (t) {
            e("#yilou_zst_chart").html(t.html)
        },
			u = function (n, r) {
			    var i = e("#mini-zst");
			    i.html(n), i.find(".period-tab li[type=" + r + "]").addClass("active").siblings().removeClass("active");
			    var s = {
			        dstID: "chart-svg",
			        offset: {
			            left: 0,
			            top: 0
			        }
			    };
			    s.config = _.extend({}, t.pages.zst_config[r]), _.isEmpty(s.config) || setTimeout(function () {
			        i.is(":visible") && t.pages.draw.zstLine(e.extend(!0, {}, s))
			    }, 1)
			},
			a, f, l;
        _.include([t.lottery.lott_type_id.sscjx, t.lottery.lott_type_id.ssccq, t.lottery.lott_type_id.k3gx, t.lottery.lott_type_id.k3jl, t.lottery.lott_type_id.k3js, t.lottery.lott_type_id.k3nm, t.lottery.lott_type_id.k3hb], t.pages.lott_type_id) ? (f = t.pages.zst_type || e(".period-tab .active").attr("type") || "dww1", a = i[t.pages.lott_type_id] + "/zst2/?chartType=" + f + "&topCount=" + (t.pages.zst_count || 10) + "&lotIssue=" + (n || ""), l = t.pages.zst_cache[f], l && n ? (u(l, f), t.pages.zst_init && typeof t.pages.zst_init == "function" && t.pages.zst_init()) : t.pages.get_lott_data("syxw_zst", a, s, function (e) {
            n || (t.pages.zst_cache = {}, t.pages.zst_cache_log.push({
                issue: t.pages.issue,
                status: "clear",
                type: f
            })), t.pages.zst_cache[f] = e.html, u(e.html, f), t.pages.zst_init && typeof t.pages.zst_init == "function" && t.pages.zst_init(), t.pages.zst_cache_log.push({
                issue: t.pages.issue,
                status: "cache",
                type: f
            })
        }, 3e3, 10, 15)) : (a = i[t.pages.lott_type_id] + "/zst/?topCount=" + r + "&lotIssue=" + (n || ""), t.pages.get_lott_data("syxw_zst", a, s, o))
    }, t.pages.dxjo = function (n, r) {
        e(".dxjo a").on("click", function (i) {
            i.preventDefault();
            var s = e.trim(e(this).text()),
				o = e(this).parents(".t").siblings(".v").find(".boll-list .btn-boll"),
				u = t.pages.sel_act,
				a = parseInt(o.length / 2);
            switch (s) {
                case "\u62d6\u7801\u5168\u5305":
                case "\u5168":
                    o.addClass(u);
                    break;
                case "\u5947":
                    o.each(function () {
                        e(this).text() % 2 ? e(this).addClass(u) : e(this).removeClass(u)
                    });
                    break;
                case "\u5076":
                    o.each(function () {
                        e(this).text() % 2 ? e(this).removeClass(u) : e(this).addClass(u)
                    });
                    break;
                case "\u5927":
                    o.filter(":gt(" + (a - 1) + ")").addClass(u), o.filter(":lt(" + a + ")").removeClass(u);
                    break;
                case "\u5c0f":
                    o.filter(":gt(" + (a - 1) + ")").removeClass(u), o.filter(":lt(" + a + ")").addClass(u);
                    break;
                case "\u6e05\u9664":
                    o.removeClass(u)
            }
            _.isFunction(r) && r.call(o.parents(".boll-list"), s), _.isFunction(n) && n.call(null)
        })
    }, t.pages.sel_code = function (n, r) {
        e(".boll-list:not(.boll-list-sha)").on("click", ".btn-boll", function (i) {
            i.preventDefault();
            var s = e(this);
            s.removeClass("btn-boll-tips").toggleClass(t.pages.sel_act), _.isFunction(r) && r.call(s), _.isFunction(n) && n.call(null)
        })
    }, t.pages.clear_sel = function () {
        e(".sel_info:visible b").text("0"), e(".sel_info:visible em").html(""), e(".boll-list:visible").find(".btn-boll").removeData("click_n").removeClass(t.pages.sel_act + " btn-boll-dis btn-boll-tips"), e(".boll-list:visible").find(".k3-btn-boll").removeClass("k3-btn-boll-active"), e(".codelist").find(".libgred").removeClass("libgred"), t.pages.modi_zx = 0, t.pages.modi_dt = 0, t.pages.modi = {}, e("#confirm_sel_code .r").text("\u786e\u8ba4\u9009\u53f7");
        var n = e(".paste-code:visible");
        n.length && (t.pages.paste_code = [], t.pages.paste_error = [], n.val("")), t.pages.luck && t.pages.luck.clear_sel && t.pages.luck.clear_sel()
    }, t.pages.add_codes = function (n, r) {
        var i = [],
			s = n.length,
			o = "\u5355\u5f0f",
			u, a = 0;
        for (var f = 0; f < s; f++) {
            u = n[f], o = u[2] > 1 ? "\u590d\u5f0f" : "\u5355\u5f0f", _.isArray(u[1]) && (u[1] = u[1] + ""), u[1].indexOf("$") > -1 && (o = "\u80c6\u62d6"), a += u[2];
            var l = u[0][0] ? u[0][0] + "|" + u[1] : u[1].replace(/\s\+\s/g, "+");
            switch (t.pages.lott_type_id) {
                case t.lottery.lott_type_id.sscjx:
                case t.lottery.lott_type_id.ssccq:
                    if (u[0][0] == "DD") l = t.string.mul_replace(l, [
                        [/\u5927/g, "2"],
                        [/\u5c0f/g, "1"],
                        [/\u5355/g, "5"],
                        [/\u53cc/g, "4"]
                    ]);
                    else if (u[0][0] == "Z2" || u[0][0] == "Z3" || u[0][0] == "Z6") l = l.replace(/-,/g, "");
                    break;
                case t.lottery.lott_type_id.k3jl:
                case t.lottery.lott_type_id.k3nm:
                case t.lottery.lott_type_id.k3js:
                case t.lottery.lott_type_id.k3hb:
                case t.lottery.lott_type_id.k3gx:
                    if (u[0][0] == "3LT" || u[0][0] == "3TT") l = l.replace("\u4e09\u8fde\u53f7\u901a\u9009", "***").replace("\u4e09\u540c\u53f7\u901a\u9009", "***");
                    break;
                case t.lottery.lott_type_id.pk3:
                    switch (u[0][0]) {
                        case "HD":
                        case "TD":
                            var c = {
                                "\u9ed1\u6843": "111",
                                "\u7ea2\u6843": "222",
                                "\u6885\u82b1": "333",
                                "\u65b9\u5757": "444"
                            };
                            l = l.replace(/([\u4E00-\u9FFF]{2})/g, function (e) {
                                return c[e]
                            });
                            break;
                        case "HB":
                        case "TB":
                        case "BB":
                        case "SB":
                            l = l.replace("\u5305\u9009", "***");
                            break;
                        case "DB":
                            l = l.replace("\u5305\u9009", "**");
                            break;
                        case "DD":
                            l = l.replace(/1010/g, "00").replace(/\,/g, "/");
                            break;
                        case "SD":
                            l = l.replace(/10/g, "0").replace(/\,/g, "/");
                            break;
                        case "BD":
                            l = l.replace(/101010/g, "000").replace(/\,/g, "/");
                            break;
                        default:
                            l = l.replace(/0(?=\d)|\s|1/g, "").replace("R|", "R1|")
                    }
            }
            var h = {
                plays: (u[0][1] || "") + (u[0][2] || o),
                count: u[2],
                money: u[2] * t.pages.price,
                code: u[1].replace(/(\+\s?)(.+)$/g, '$1<b class="blue">$2</b>'),
                bonus: u[3] || 0,
                codes: l
            },
				p = '<span class="modi"  count="<%=count%>">\u4fee\u6539</span>',
				d = e.inArray(t.pages.lott_type_id, [t.lottery.lott_type_id.sd, t.lottery.lott_type_id.p3]) != -1 && u[0][0] != "Z1",
				v = e.inArray(t.pages.lott_type_id, [t.lottery.lott_type_id.ssccq, t.lottery.lott_type_id.sscjx]) != -1 && e.inArray(u[0][0], ["Z2", "Z3", "Z6", "F2", "F3", "F6"]) > -1,
				m = e.inArray(t.pages.lott_type_id, [t.lottery.lott_type_id.k3jl, t.lottery.lott_type_id.k3js, t.lottery.lott_type_id.k3nm, t.lottery.lott_type_id.k3gx, t.lottery.lott_type_id.k3hb]) != -1 && e.inArray(u[0][0], ["HSZ", "2BT", "3BT"]) < 0,
				g = e.inArray(t.pages.lott_type_id, [t.lottery.lott_type_id.pk3]) != -1 && e.inArray(u[0][0], ["R1", "R2", "R3", "R4", "R5", "R6", "DD", "BD", "SD"]) < 0;
            if (d || v || m || g) p = "";
            var y = ' <li class="active" codes="<%=codes%>" bonus="<%=bonus%>"><span class="del"  count="<%=count%>">\u5220\u9664</span>' + p + '<div class="code"><b><%=plays%></b><b class="em"><%=code%></b>  [<%=count%>\u6ce8,<em class="code-list-money"><%=money%></em>\u5143]</div></li>',
				b = _.template(y);
            i.push(b(h))
        }
        var w = e(".codelist"),
			p = w.find(".libgred");
        if (p.length > 0 && s == 1 && r) {
            var E = p.find(".del").attr("count") * 1;
            a -= E, p.replaceWith(i.join("")), t.pages.modi = {}, e("#confirm_sel_code .r").text("\u786e\u8ba4\u9009\u53f7")
        } else w.prepend(i.join(""));
        w.find("li").length > 1 && t.pages.get_buy_type() == "zntrace" && e("input[value=bet]").trigger("click"), t.pages.totle(a), t.pages.money_change(), w.parents(".content").scrollTop(0), setTimeout(function () {
            w.find(".active").removeClass("active")
        }, 800)
    }, t.pages.code_box = function () {
        e(".codelist").on("mouseover", "li", function () {
            e(this).addClass("active")
        }).on("mouseout", "li", function () {
            e(this).removeClass("active")
        }), e(".codelist").on("click", ".del", function () {
            var n = e(this).parents("li");
            if (n.hasClass("libgred")) if (e.isFunction(t.pages.modi_del_callback)) t.pages.modi_del_callback.call(this);
            else {
                var r = t.pages.get_plays_box();
                t.pages.modi_zx && (r == "zx" ? t.pages.clear_sel() : e(".plays_box .plays").eq(e("#plays li").index(e("#plays li[desc=zx]"))).find(".btn-boll").removeClass("btn-boll-active btn-boll-tips")), t.pages.modi_dt && (r == "zx" ? t.pages.clear_sel() : e(".plays_box .plays").eq(e("#plays li").index(e("#plays li[desc=dt]"))).find(".btn-boll").removeClass("btn-boll-active btn-boll-tips")), t.pages.modi_zx = 0, t.pages.modi_dt = 0
            }
            n.remove();
            var i = e(this).attr("count") * -1;
            t.pages.totle(i), e("#mul").trigger("blur")
        }), e(".codelist").on("click", ".modi", function () {
            var n = e(this).parents("li");
            n.addClass("libgred").siblings(".libgred").removeClass("libgred"), e("#confirm_sel_code .r").text("\u786e\u8ba4\u4fee\u6539"), e.isFunction(t.pages.modi_code) && (t.pages.modi_code.call(n), e("body").animate({
                scrollTop: 125
            }, 200))
        }), e("#mul").on("keyup blur", function (n) {
            var r = ("0" + e(this).val().replace(/\D/g, "")) * 1;
            r > t.pages.max_mul && (r = t.pages.max_mul), n.type == "blur" && (r = r || 1), e(this).val(r || ""), t.pages.totle(), t.pages.money_change()
        }), t.pages.tmp_sto = setTimeout(function () {
            return
        }, 3e4), e(".qkmethod .btn-middle").on("click", function (n) {
            n.preventDefault();
            var r = e(this).attr("count") * 1,
				i = t.pages.get_plays(),
				s = t.lottery["random_plays" + t.pages.lott_type_id](i),
				o = e(".codelist"),
				u, a, f = s[0];
            e.inArray(t.pages.lott_type_id, [t.lottery.lott_type_id.sscjx, t.lottery.lott_type_id.ssccq]) != -1 && i[0] == "Z6" && (f = "Z6"), r ? (u = t.lottery.random({
                lott_type_id: t.pages.lott_type_id,
                plays: f,
                count: r
            }), a = _.map(u, function (e, t) {
                return [s, e, 1]
            }), t.pages.add_codes(a), e("#cd_list_try").hide(), clearTimeout(t.pages.tmp_sto)) : (o.html(""), e("#count").text("0"), e("#money").text("0"), t.pages.tmp_count_zx = 0, t.pages.money_change())
        })
    }, t.pages.money_change = function () {
        t.pages.zh && t.pages.zh.reset && t.pages.zh.reset(), t.pages.znzh && t.pages.znzh.reset && t.pages.znzh.reset()
    }, t.pages.totle = function (n, r) {
        n = n || 0, r = r || 0;
        var i = e("#count"),
			s = e("#mul"),
			o = e("#money"),
			u = e.trim(i.text()) * 1 + n,
			r = s.val() * 1 + r;
        i.text(u), s.val(r || ""), o.hide().html(u * r * t.pages.price).show().css("display", "inline-block");
        var a = e("#plays .active").attr("maxplay");
        t.pages["tmp_count_" + a] = u, t.pages["tmp_mul_" + a] = r
    }, t.pages.buy_type = function () {
        e("#buy_type .rd-group input").on("click", function () {
            var n = e(this).val();
            e("#buy_type .tips").html(e(this).attr("desc"));
            var r = e("#buy_type_content .tab-pane");
            n == "bet" ? r.hide() : n == "trace" ? (r.eq(0).show(), r.eq(1).hide(), t.pages.zh.reset && t.pages.zh.reset()) : (t.pages.znzh.reset && t.pages.znzh.reset(), r.eq(1).show(), r.eq(0).hide(), e("#zhTip").hide())
        }), e("#zhTip").on("click", function () {
            e("#buy_type .rd-group input:eq(2)").trigger("click")
        }), e(".type_tips").on("mouseover", ".ico", function () {
            var n = e(this).attr("val"),
				r = {
				    bet: "<span>\u81ea\u8d2d\uff1a</span>\u9009\u597d\u6295\u6ce8\u53f7\u7801\u540e\uff0c\u7531\u81ea\u5df1\u5168\u989d\u652f\u4ed8\u8d2d\u5f69\u6b3e\uff1b\u4e2d\u5956\u540e\uff0c\u81ea\u5df1\u72ec\u4eab\u5168\u90e8\u7a0e\u540e\u5956\u91d1",
				    trace: "<span>\u8ffd\u53f7\uff1a</span>\u9009\u597d\u6295\u6ce8\u53f7\u7801\u540e\uff0c\u5bf9\u671f\u6570\u3001\u671f\u53f7\u3001\u500d\u6570\u8fdb\u884c\u8bbe\u7f6e\u540e\uff0c\u7cfb\u7edf\u6309\u7167\u8bbe\u7f6e\u8fdb\u884c\u8d2d\u4e70",
				    zntrace: "<span>\u667a\u80fd\u8ffd\u53f7\uff1a</span>\u9009\u62e9\u60a8\u8981\u8ffd\u53f7\u7684\u671f\u6570\u548c\u8d77\u59cb\u500d\u6570\uff0c\u7136\u540e\u901a\u8fc7\u5bf9\u6295\u6ce8\u65b9\u6848\u7684\u6700\u4f4e\u76c8\u5229\u91d1\u989d\u6216\u6700\u4f4e\u76c8\u5229\u5229\u7387\u5408\u7406\u8bbe\u7f6e\uff0c\u4ece\u800c\u66f4\u76f4\u89c2\u7684\u638c\u63e1\u65b9\u6848\u76c8\u5229\u60c5\u51b5"
				};
            t.lightbox.tips_tmp = t.lightbox.tips({
                offset_box: e(this),
                content: r[n].replace(/^zn/g, ""),
                width: 260,
                left: -30
            })
        }).on("mouseout", ".ico", function () {
            t.lightbox.tips_tmp.close()
        })
    }, t.pages.get_buy_type = function () {
        return e("#buy_type .rd-group input:checked").val()
    }, t.pages.get_post_code = function () {
        var t = e.map(e(".codelist li"), function (t) {
            return e(t).attr("codes")
        });
        return t.join(";")
    }, t.pages.own_buy_param = function () {
        var n = {
            buy_type: "bet",
            LotID: t.pages.lott_type_id,
            PlayID: t.pages.play_id,
            BetCodes: t.pages.get_post_code(),
            OneMoney: t.pages.price,
            BetPageID: t.pages.bet_page_id || 1010,
            DrawNo: t.pages.issue,
            BetMoney: e.trim(e("#money").text()),
            BetMulti: e("#mul").val()
        };
        return n
    }, t.pages.post_bet = function () {
        e("#post_data").on("click", function (n) {
            n.preventDefault();
            var r = t.pages.get_buy_type(),
				i = e("#plays .active").attr("maxplay"),
				s, o = "";
            t.pages.is_sale ? t.pages.is_end ? o = "\u7b49\u5f85\u5f00\u5956\uff0c\u8bf7\u7a0d\u540e\u6295\u6ce8" : e("#user_xieyi").prop("checked") ? e("#user_xianhao").length && !e("#user_xianhao").prop("checked") && (o = "\u8bf7\u5148\u9605\u8bfb\u5e76\u540c\u610f\u300a\u9650\u53f7\u6295\u6ce8\u98ce\u9669\u987b\u77e5\u300b") : o = "\u8bf7\u5148\u9605\u8bfb\u5e76\u540c\u610f\u300a\u7528\u6237\u59d4\u6258\u6295\u6ce8\u534f\u8bae\u300b" : o = "\u6295\u6ce8\u5df2\u6682\u505c";
            if (o) {
                t.lightbox.alert({
                    content: o
                });
                return
            } !e.trim(e(".codelist").html()) && e(".sel_info:visible b:first").text() * 1 > 0 && i != "sha" && e("#confirm_sel_code").trigger("click"), s = t.pages.own_buy_param();
            switch (i) {
                case "ds":
                    o = "\u8bf7\u5148\u4e0a\u4f20\u53f7\u7801", e.extend(s, t.pages.ds.param());
                    break;
                case "xfq":
                    o = "\u8bf7\u5148\u8bbe\u7f6e\u6295\u6ce8\u6ce8\u6570", e.extend(s, t.pages.xfq.param());
                    break;
                case "jx":
                    o = "\u8bf7\u5148\u8bbe\u7f6e\u6295\u6ce8\u671f\u6b21", e.extend(s, t.pages.issues_random.param());
                    break;
                default:
                    o = "\u8bf7\u5148\u9009\u53d6\u6295\u6ce8\u53f7\u7801"
            }
            if (s.BetMoney < 1) {
                t.lightbox.alert({
                    content: o
                });
                return
            }
            if (t.pages.endtime_prev_dis && t.pages.countdown_sale.t < t.pages.endtime_prev_dis_time) {
                var u = s.BetMoney * 1 / (s.OneMoney * 1) / (s.BetMulti * 1) > (t.pages.endtime_prev_dis_count || 1e6),
					a = s.BetMoney > (t.pages.endtime_prev_dis_money || 5e6);
                if (u || a) {
                    var f = "",
						l = t.countdown.to_dhms(t.pages.endtime_prev_dis_time),
						c = u ? t.pages.endtime_prev_dis_count + "\u6ce8" : "",
						h = u ? t.pages.endtime_prev_dis_money + "\u5143" : "",
						p = ["\u5929", "\u5c0f\u65f6", "\u5206\u949f", "\u79d2"];
                    for (var d = 0; d < l.length; d++) l[d] && (f += l[d] + p[d]);
                    o = t.lottery.lott_type_cn[t.pages.lott_type_id] + ' \u5728\u6295\u6ce8\u622a\u6b62\u524d<b class="red">' + f + '\u5185</b>\u6700\u591a\u8d2d\u4e70<b class="red">' + (c || h) + "</b>", t.lightbox.alert({
                        pop_box_style: 'style="width:430px;"',
                        content: o
                    });
                    return
                }
            }
            var v = s.buy_type;
            if (r == "team") e.extend(s, t.pages.hm.param());
            else if (r == "trace" && !s.IsRandom) {
                e.extend(s, t.pages.zh.param());
                if (s.TotalMoney < 1) {
                    t.lightbox.alert({
                        content: "\u81f3\u5c11\u8981\u8ffd\u4e00\u671f"
                    });
                    return
                }
            } else if (r == "zntrace" && !s.IsRandom) {
                e.extend(s, t.pages.znzh.param());
                if (s.TotalMoney < 1) {
                    t.lightbox.alert({
                        content: "\u8bf7\u5148\u751f\u6210\u8ffd\u53f7"
                    });
                    return
                }
            }
            v == "pteambet" && (s.buy_type = "pteambet");
            if (!t.lottery.lott_type_str[t.pages.lott_type_id + ""]) {
                t.lightbox.alert({
                    content: "\u5f69\u79cd\u53c2\u6570\u6709\u8bef\uff0c\u8bf7\u8054\u7cfb\u5728\u7ebf\u5ba2\u670d"
                });
                return
            }
            t.lottery.post_data(s, function () {
                e("#post_data").trigger("click")
            })
        })
    }, t.pages.user_xieyi = function () {
        e("#user_xieyi_content").on("click", function (e) {
            e.preventDefault(), t.lightbox.touzhuxieyi()
        }), e("#user_xianhao_content").on("click", function (e) {
            e.preventDefault(), t.lightbox.touzhuxianhao()
        })
    }, t.pages.aside = function () {
        t.pages.is_kaijiang, e("#open_code_list li").eq(0).text() == "?" && t.pages.get_open_code(), t.ui.tab({
            control: "#paihang li",
            content: "#paihang_content .tab-pane",
            default_selected: t.pages.paihang || 0,
            prevent_default: 0,
            current_class: "active"
        }), t.pages.aside_update_xtstat_evt(), e("#open_code_list_ctrl").on("click", function (t) {
            var n = e(".open-code-list:visible");
            n.length ? (n.slideUp(), e(this).html('\u5c55\u5f00<i class="ico ico-numtableup"></i>')) : (e(".open-code-list").slideDown(), e(this).html('\u6536\u8d77<i class="ico ico-numtabledown"></i>'))
        })
    }, t.pages.aside_update_xtstat_evt = function () {
        var e = 0;
        t.pages.issue % 100 < 20 && (e = 1), t.ui.tab({
            control: "#yilou li",
            content: "#yilou_content .tab-pane",
            default_selected: e,
            prevent_default: 0,
            current_class: "active"
        })
    }, t.pages.my_helper_init = function () {
        e(".lottery-list").on("click", "li[issue]", function (n) {
            var r = e(this);
            if (!t.cookie.get("Q")) {
                t.passport.login(function () {
                    r.trigger("click")
                });
                return
            }
            var i = e(this).attr("issue"),
				s = "/int/qbetlist?lotID=" + t.pages.lott_type_id + "&issue=" + i + "&_t=" + +(new Date);
            i && e.ajax({
                url: s,
                dataType: "json"
            }).done(function (e) {
                if (e && e.RecordCount * 1 > 0) {
                    var n = e.Records,
						r = [],
						i = n.length;
                    r.push('<p style="font-size:12px;margin:15px 10px 10px;overflow: hidden;zoom: 1;"><span class="fr"><a href="/pfbet/" target="_blank" class="lnk">\u6295\u6ce8\u8bb0\u5f55</a> | <a class="lnk" href="/pftrace/" target="_blank">\u8ffd\u53f7\u8bb0\u5f55</a></span>'), r.push("<b>" + t.lottery.lott_type_cn[t.pages.lott_type_id] + ' <b class="orange">' + n[0].DrawNo + "</b> \u671f</b> \u65b9\u6848\u9884\u89c8</p>"), r.push('<div class="kpproid" ><table width="100%"><thead><tr style="height:28px;"><th>\u8d2d\u5f69\u65f6\u95f4</th><th>\u8d2d\u5f69\u65b9\u5f0f</th><th>\u6211\u8d2d\u4e70\u4e86</th><th>\u6211\u7684\u5956\u91d1</th><th>\u51fa\u7968\u72b6\u6001</th><th>\u64cd\u4f5c</th></tr></thead><tbody>');
                    for (var s = 0; s < i; s++) r.push('<tr><td style="line-height:15px;">' + n[s].BuyTime.replace(/:\d\d$/g, "").replace(/\s/g, "<br>") + "</td>"), r.push("<td>" + n[s].PlayTypeName + "</td>"), r.push('<td><b class="orange">' + n[s].BuyMoney + "</b>\u5143</td>"), r.push("<td>" + (n[s].Bonus * 1 > 0 ? '<b class="orange">' + n[s].Bonus + "</b>\u5143" : n[s].BonusHtml) + "</td>"), r.push("<td>" + n[s].BillHtml + "</td>"), r.push('<td><a class="lnk" href="' + n[s].ProjUrl + '" target="_blank">\u67e5\u770b\u53f7\u7801</a></td></tr>');
                    r.push("</tbody></table></div>"), t.lightbox.frame({
                        content: r.join(""),
                        pop_box_style: 'style="width:500px;"',
                        title: "\u65b9\u6848\u9884\u89c8"
                    })
                }
            })
        }).on("click", "a", function (e) {
            e.preventDefault()
        }), e(".helper-nav").on("click", function (n) {
            if (!t.cookie.get("Q")) {
                t.passport.login(function () {
                    e(".helper-nav").trigger("click")
                });
                return
            }
            var r = e(this).find(".ico");
            r.get(0).className.indexOf("arrow03") > -1 ? r.toggleClass("ico-arrow03-up") : r.toggleClass("ico-arrow02-up");
            var i = e(".cz-helper");
            e(".mod-cz-bd").addClass("mod-kpcz-bd"), e(this).find(".ico-arrow02-up,.ico-arrow03-up").length ? i.slideDown(200) : i.slideUp(200, function () {
                e(".mod-cz-bd").removeClass("mod-kpcz-bd")
            }), t.pages.get_my_helper()
        }), e("#my_helper_refresh").on("click", function (n) {
            n.preventDefault(), e("#my_loading").show(), t.pages.get_my_helper()
        }), e("#my_helper_up").on("click", function (t) {
            t.preventDefault(), e(".cz-helper").slideUp(300, function () {
                e(".mod-cz-bd").removeClass("mod-kpcz-bd")
            }), e(".helper-nav").find(".ico").removeClass("ico-arrow02-up ico-arrow03-up")
        })
    }, t.pages.get_my_helper = function () {
        var n = e(".helper-nav .ico-arrow02-up,.helper-nav .ico-arrow03-up");
        if (n.length) {
            if (!t.cookie.get("Q")) {
                n.trigger("clcik");
                return
            }
            t.get_my_helper_ajax()
        }
    }, t.get_my_helper_ajax = function () {
        var n = "/int/qtopbetlistv2?datatype=json&LotID=" + t.pages.lott_type_id + "&TopCount=12";
        e.ajax({
            url: n,
            dataType: "json",
            data: {
                t: +(new Date)
            }
        }).done(function (e) {
            e ? t.pages.get_my_helper_callback(e) : (clearTimeout(t.pages.get_my_helper.stt), t.pages.get_my_helper.stt = setTimeout(t.pages.get_my_helper, 2e3))
        }).fail(function () {
            clearTimeout(t.pages.get_my_helper.stt), t.pages.get_my_helper.stt = setTimeout(t.pages.get_my_helper, 2e3)
        })
    }, t.pages.get_my_helper_callback = function (n) {
        var r = [],
			i, s = "$1-$2";
        switch (t.pages.lott_type_id) {
            case t.lottery.lott_type_id.kl8:
                i = /(\d+)/g, s = "$1";
                break;
            case t.lottery.lott_type_id.ssccq:
                i = /\d+(\d{2})(\d{3})$/g;
                break;
            case t.lottery.lott_type_id.sscjx:
                i = /\d+(\d{2})\d(\d{2})$/g;
                break;
            default:
                i = /\d+(\d{2})(\d{2})$/g
        }
        _.each(n, function (e, t) {
            var n = "",
				o = ' issue="' + e.issue + '"';
            e.status == "\u4e2d\u5956" ? n = '<b class="fsz14">' + e.money * 1 + "</b>\u5143" : e.count < 1 ? (n = '<em class="gray">\u65e0\u8bb0\u5f55</em>', o = "") : n = '<b class="fsz14" issue="' + e.issue + '">' + e.count + "</b>\u7b14\u8ba2\u5355", r.push("<li " + (t ? "" : 'class="active"') + " " + o + '><a href="javascript:;"><p><b>' + e.issue.replace(i, s) + "\u671f</b></p><p " + (e.status == "\u6b63\u5728\u9500\u552e" ? 'class="red"' : "") + ">" + e.status + "</p><p>" + n + "</p></a></li>")
        }), e(".lottery-list").html(r.join("")), e("#my_loading").hide(), n[1].status == "\u7b49\u5f85\u5f00\u5956" && (clearTimeout(t.pages.get_my_helper.stt), t.pages.get_my_helper.stt = setTimeout(t.pages.get_my_helper, 2e3))
    }, t.pages.yilou_zst_init = function () {
        t.pages.get_zst("0"), e(".plays_box .fr-tab .numcount").on("mouseover", function () {
            t.pages.lott_data || t.pages.get_yilou("lotIssue=0")
        }).on("click", function (t) {
            t.preventDefault();
            var n = e(this);
            n.hasClass("act") ? (n.removeClass("act").find(".ico-numtabledown").addClass("ico-numtableup"), e(".tools-boll-xssc").hide()) : (n.addClass("act").find(".ico-numtabledown").removeClass("ico-numtableup"), n.siblings(".chart").removeClass("act"), e(".tools-boll-xssc").show(), e(".tools-boll-chart").hide())
        }), e(".plays_box .fr-tab .chart").on("mouseover", function () {
            e(this).data("is") != "1" && !e("#yilou_zst_chart").html() && (t.pages.get_zst("0"), e(this).data("is", "1"))
        }).on("click", function (n) {
            e(this).hasClass("act") ? (e(this).removeClass("act").siblings(".numcount").find(".ico-numtabledown").addClass("ico-numtableup"), e(".tools-boll-chart").hide()) : (n.preventDefault(), e(this).addClass("act").siblings(".numcount").removeClass("act").find(".ico-numtabledown").removeClass("ico-numtableup"), e(".tools-boll-xssc").hide(), _.include([t.lottery.lott_type_id.ssccq, t.lottery.lott_type_id.sscjx, t.lottery.lott_type_id.k3gx, t.lottery.lott_type_id.k3jl, t.lottery.lott_type_id.k3js, t.lottery.lott_type_id.k3nm, t.lottery.lott_type_id.k3hb], t.pages.lott_type_id) && t.pages.get_zst("0"), e(".tools-boll-chart").show())
        }), t.ui.select({
            sel: "#yilou_play_list",
            box: ".xssc-select",
            callback: function () {
                e(".num-list ul").removeClass().addClass(e("#yilou_play_list").val().toLowerCase()), t.pages.update_yilou && t.pages.update_yilou()
            }
        }), e(".num-list").on("click", ".btn-middle", function (n) {
            var r = e(this).text().replace(/[^\d\.\,\s]/g, "").split(/\.|\,/),
				i = e("#yilou_play_list").val(),
				s = e("input[value^=" + i + "]");
            e("#plays li[desc=" + s.attr("name").toUpperCase() + "]").trigger("click"), s.index(s.filter(":checked")) && s.eq(0).trigger("click");
            var o = e(".boll-list:visible"),
				u = _.include([t.lottery.lott_type_id.ssccq, t.lottery.lott_type_id.sscjx], t.pages.lott_type_id) ? 0 : 1;
            o.each(function (n, i) {
                var s = e(i).find(".btn-boll"),
					o;
                r[n] && (o = r[n].split(" "), s.removeClass(t.pages.sel_act), _.each(o, function (e) {
                    s.eq(e * 1 - u).addClass(t.pages.sel_act)
                }))
            }), t.pages.sel_count()
        });
        var n = e(".tools-boll-chart");
        n.on("click", ".period-tab li:not(.not)", function (n) {
            n.preventDefault(), e(this).addClass("active").siblings("li").removeClass("active"), t.pages.zst_type = e(this).attr("type"), t.pages.zst_count = e(this).attr("count") || 10, t.pages.get_zst("0")
        })
    }, t.pages.loaded_auto_pub = function () {
        var n = window.location.href;
        e.trim(e(".codelist").html()) && e("#mul").trigger("blur");
        var r = t.string.get_url_param("play", n).toLocaleUpperCase();
        r && e("#plays li[desc=" + r + "]").trigger("click");
        var i = t.string.get_url_param("bt", n);
        i == "hm" ? e("input[value=team]").trigger("click") : i == "zh" ? e("input[value=trace]").trigger("click") : i == "znzh" && e("input[value=zntrace]").trigger("click")
    }, t.pages.pay_succ_callback = function () {
        for (var e = 0; e < 5; e++) setTimeout(function () {
            t.pages.get_my_helper && t.pages.get_my_helper()
        }, 1e3 * e)
    }, t.pages.favcode = function () {
        t.pages.recid = 0, e(".favcode").on("click", function (n) {
            n.preventDefault();
            var r = e(this);
            if (!t.cookie.get("Q")) return t.passport.login(function () {
                r.trigger("click")
            }), !1;
            if (e("#count").text() == "0") {
                t.lightbox.alert({
                    content: "\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u6ce8\u53f7\u7801\uff01"
                });
                return
            }
            if (e(".codelist").find("li").length > 1e3) {
                t.lightbox.alert({
                    content: "\u4fdd\u5b58\u65b9\u6848\u6700\u5927\u53ea\u652f\u63011000\u6ce8\uff01"
                });
                return
            }
            var i = {
                LotID: t.pages.lott_type_id,
                DrawNo: t.pages.issue,
                tk: e("#tk").val(),
                BetCodes: t.pages.get_post_code()
            };
            e.ajax({
                url: "/pfsavedcode/save/",
                type: "POST",
                data: i,
                dataType: "json",
                success: function (n) {
                    n.xCode == "0" ? (t.pages.recid = n.data, t.lightbox.show({
                        html: e("#saveplan").html(),
                        cancel_sel: ".close,.btn-panel-primary",
                        callback: function () {
                            var r = '<span class="kl" >\u60a8\u5df2\u7ecf\u6210\u529f\u4fdd\u5b58\u4e86<em class="red succnt">' + n.succnt + "</em>\u4e2a\u65b9\u6848";
                            e("#lotname").html(t.lottery.lott_type_cn[t.pages.lott_type_id]), e(".qissue").text(t.pages.issue), e(".myplan-fm-item").html(r)
                        }
                    })) : t.lightbox.alert({
                        content: n.xMessage
                    })
                }
            })
        }), e(".favimport").on("click", function (n) {
            n.preventDefault();
            var r = e(this);
            if (!t.cookie.get("Q")) return t.passport.login(function () {
                r.trigger("click")
            }), !1;
            e.ajax({
                url: "/pfsavedcode/listdata?LotID=" + t.pages.lott_type_id + "&t=" + +(new Date),
                dataType: "json",
                success: function (n) {
                    if (n.xCode == "0") {
                        var r = n.data.length,
							i = 0,
							s = [];
                        if (r > 0) {
                            for (; i < r; i++) {
                                var o = n.data[i].ID,
									u = n.data[i].LotID,
									a = n.data[i].BetCodes,
									f = n.data[i].ChipCount,
									l = n.data[i].TotalMoney,
									c = n.data[i].DrawNo,
									h = n.data[i].CreateTime,
									p = i % 2 == 1 ? "myplan-cur" : "",
									d = n.data[i].LotName,
									v = {
									    id: o,
									    lotid: u,
									    cur: p,
									    count: f,
									    money: l,
									    code: a,
									    iss: c,
									    lotname: d,
									    date: h
									},
									m = '<tr codes="<%=code%>" class="<%=cur%>" lotid="<%=lotid%>"> <td width="205" class="t-l"><label><input type="checkbox"> <b>&nbsp;&nbsp;<%=lotname%>\u7b2c<%=iss%>\u671f</b></label></td><td width="120"><%=count%>\u6ce8<%=money%>\u5143</td><td><a class="lnk" target="_blank" href="/pfsavedcode/betcodes?RecID=<%=id%>">\u67e5\u770b\u53f7\u7801</a></td></tr>',
									g = _.template(m);
                                s.push(g(v))
                            }
                            t.lightbox.show({
                                html: e("#importplan").html(),
                                cancel_sel: ".close",
                                callback: function () {
                                    e("#importlist").html(s.join("")), t.pages.impor_two()
                                }
                            })
                        }
                    } else t.lightbox.show({
                        html: e("#tipsplan").html(),
                        cancel_sel: ".close,.btn-panel-primary"
                    })
                }
            })
        }), t.pages.impor_two = function () {
            e("#checkall").on("click", function () {
                e(this).prop("checked") ? e("#importlist input").each(function () {
                    e(this).prop("checked", 1)
                }) : e("#importlist input").each(function () {
                    e(this).prop("checked", 0)
                })
            }), e("#importlist").on("click", "input", function () {
                var t = 0,
					n = 0;
                e("#importlist input").each(function () {
                    t++, n++;
                    if (!e(this).prop("checked")) return n--, !1
                }), n == t ? e("#checkall").prop("checked", 1) : e("#checkall").prop("checked", 0)
            }), e("#importfa").on("click", function (n) {
                n.preventDefault(), t.pages.d_count = 0;
                var r = e("#importlist").find("input:checked").length;
                if (r == 0) {
                    e("#errorTips").text("\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u65b9\u6848\u5bfc\u5165");
                    return
                }
                e("#errorTips").text("");
                var i = e("#count").text() * 1,
					s = [];
                e("#importlist tr").each(function (n) {
                    var r = e(this);
                    if (r.find("input").prop("checked")) {
                        var o = r.attr("lotid"),
							u = r.attr("codes"),
							a = u.split(";"),
							f = a.length,
							l = 0;
                        for (; l < f; l++) {
                            var c = !0;
                            if (a[l].indexOf("|") > -1) {
                                var h = a[l].split("|")[0];
                                e.inArray(h, ["3TT", "3TD", "2TF", "2TD", "3LT", "DB", "BB", "TB", "TD", "HD", "HB", "SB", "Z3", "Z2", "F2"]) > -1 && (c = !1)
                            }
                            var p = t.pages.back_data(o, a[l]);
                            i += t.pages.d_count;
                            var d = '<li codes="<%=code%>"><span count="<%=count%>" class="del">\u5220\u9664</span>';
                            c && (d += '<span count="<%=count%>" class="modi">\u4fee\u6539</span>'), d += '<div class="code"><b><%=plays%></b><b class="em"><%=red%>', d += '</b>  [<%=count%>\u6ce8,<em class="code-list-money"><%=money%></em>\u5143]</div></li>';
                            var v = _.template(d);
                            s.push(v(p))
                        }
                    }
                });
                var o = e("input[name=append_post]").prop("checked") ? 3 : 2;
                e(".codelist").append(s.join("")), e("#count").text(i), e("#money").text(i * o * 1);
                var u = e("#mul"),
					a = u.val() * 1,
					f = e("#plays .active").attr("maxplay");
                t.pages["tmp_count_" + f] = i, u.val(a || ""), t.pages["tmp_mul_" + f] = a, u.trigger("blur"), t.lightbox.close()
            })
        }, t.pages.back_data = function (e, n) {
            var r = {},
				i = "what",
				s = 0,
				o, u, a, f = "";
            switch (e) {
                case "166406":
                case "165707":
                case "166907":
                case "168009":
                case "165207":
                case "166507":
                case "167607":
                    var l = 0,
                        c, h = 1,
                        p = 1,
                        d, v;
                    s = 1, a = n.split("|"), f = a[0], o = a[1], l = f.charAt(1) * 1;
                    if (o.indexOf(",") > -1) {
                        o = o.split(","), c = [];
                        for (var m = 0; m < o.length; m++) c[m] = o[m].split(" ").length * 1
                    } else c = o.split(" ").length * 1;
                    if (f.indexOf("R") > -1) {
                        d = ["", "\u4efb\u4e8c", "\u4efb\u4e09", "\u4efb\u56db", "\u4efb\u4e94", "\u4efb\u516d", "\u4efb\u4e03", "\u4efb\u516b"], v = ["\u5355\u5f0f", "\u590d\u5f0f", "\u80c6\u62d6"];
                        if (o.indexOf("$") > 0) {
                            c = o.split("$")[1];
                            var g = o.split("$")[0];
                            g = g.split(" ").length, c = c.split(" ").length, v = v[2];
                            var y = l - g;
                            for (var m = 1; m <= y; m++) h *= c, c--, p *= m;
                            h % p != 0 ? s = 1 : s = h / p
                        } else {
                            v = l == c ? v[0] : v[1], v = l == 1 ? "\u524d\u4e00\u76f4\u9009" : v;
                            for (var m = 1; m <= l; m++) h *= c, c--, p *= m;
                            h % p != 0 ? s = 1 : s = h / p
                        }
                        i = d[l - 1] + v
                    } else if (f.indexOf("Q") > -1) {
                        d = ["\u524d\u4e8c\u76f4\u9009", "\u524d\u4e09\u76f4\u9009"];
                        for (var m = 0; m < l; m++) s *= c[m];
                        i = d[l - 2]
                    } else {
                        if (!(f.indexOf("Z") > -1)) return;
                        d = ["\u524d\u4e8c\u7ec4\u9009", "\u524d\u4e09\u7ec4\u9009"];
                        if (o.indexOf("$") > 0) {
                            var b = o.indexOf("$");
                            c = o.split("$")[1], c = c.split(" ").length;
                            if (f == "Z2" || f == "Z3" && b == 5) s = c;
                            else if (f == "Z3" && b == 2) {
                                var y = c;
                                y *= y - 1, y /= 2, y % 2 != 0 && (s = 0), s = y
                            }
                            l = f.charAt(1)
                        } else {
                            for (var m = 1; m <= l; m++) h *= c, c--, p *= m;
                            if (h % p != 0) return;
                            s = h / p
                        }
                        i = d[l - 2]
                    }
                    t.pages.d_count = s;
                    break;
                case "258001":
                case "255401":
                    var l = 0,
                        d, s = 1;
                    a = n.split("|"), f = a[0], o = a[1];
                    if (f.charAt(1) == "D" && f.charAt(0) != "D" || f == "5T") {
                        d = ["\u4e00\u661f\u76f4\u9009", "\u4e8c\u661f\u76f4\u9009", "\u4e09\u661f\u76f4\u9009", "\u56db\u661f\u76f4\u9009", "\u4e94\u661f\u76f4\u9009"], l = f.charAt(0) * 1, o = o.split(",");
                        switch (f) {
                            case "5T":
                                i = "\u4e94\u661f\u901a\u9009";
                                break;
                            default:
                                i = d[l - 1]
                        }
                        for (var m = 0; m < 5; m++) o[m] != "-" && (s *= o[m].length)
                    } else if (f.charAt(0) == "D") {
                        i = "\u5927\u5c0f\u5355\u53cc";
                        var a = o;
                        o = "";
                        for (var m = 0; m < a.length; m++) switch (a.charAt(m)) {
                            case "1":
                                o += "\u5c0f";
                                break;
                            case "2":
                                o += "\u5927";
                                break;
                            case "5":
                                o += "\u5355";
                                break;
                            case "4":
                                o += "\u53cc"
                        }
                        s = 1
                    } else if (f.charAt(0) == "R") {
                        d = ["\u4efb\u4e00\u76f4\u9009", "\u4efb\u4e8c\u76f4\u9009"], l = f.charAt(1) * 1, o = o.split(",");
                        for (var m = 0; m < 5; m++) o[m] != "-" && (s *= o[m].length);
                        i = d[l - 1]
                    } else if (f.charAt(0) == "Z") {
                        l = f.charAt(1) * 1, d = ["\u4e8c\u661f\u7ec4\u9009", "\u4e09\u661f\u7ec4\u4e09", "\u4e09\u661f\u7ec4\u516d"];
                        switch (l) {
                            case 2:
                                i = d[0], s = 1, o = "-,-,-," + o;
                                break;
                            case 3:
                                s = 1;
                                var b = 0,
                                    w = o.split(",");
                                for (var m = 0; m < w.length; m++) {
                                    for (var E = m + 1; E < w.length; E++) if (w[m] == w[E]) {
                                        i = d[1], b = 1;
                                        break
                                    }
                                    b == 0 && (i = d[2])
                                }
                                o = "-,-," + o
                        }
                    } else if (f == "F2") {
                        i = "\u4e8c\u661f\u7ec4\u9009\u590d\u8bd5";
                        switch (o.length) {
                            case 3:
                                s = 6;
                                break;
                            case 4:
                                s = 10;
                                break;
                            case 5:
                                s = 15;
                                break;
                            case 6:
                                s = 21;
                                break;
                            default:
                                s = 0
                        }
                    } else if (f == "H2") {
                        o = o.split(","), i = "\u4e8c\u661f\u76f4\u9009\u548c\u503c", s = 0;
                        for (var m = 0; m < o.length; m++) o[m] > 9 ? s += 19 - parseInt(o[m]) : s += parseInt(o[m]) + 1
                    } else if (f == "S2") {
                        o = o.split(","), i = "\u4e8c\u661f\u7ec4\u9009\u548c\u503c", s = 0;
                        for (var m = 0; m < o.length; m++) o[m] > 9 ? s += Math.floor((18 - parseInt(o[m])) / 2) + 1 : s += Math.floor(parseInt(o[m]) / 2) + 1
                    } else s = 0, i = "";
                    t.pages.d_count = s;
                    break;
                case "257503":
                case "257703":
                case "258203":
                case "255803":
                case "258203":
                    s = 1;
                    var l = 0,
                        c, h = 1,
                        p = 1,
                        d, v;
                    a = n.split("|"), f = a[0], o = a[1];
                    switch (f) {
                        case "3TT":
                            i = "\u4e09\u540c\u53f7\u901a\u9009", s = 1, o = "\u4e09\u540c\u53f7\u901a\u9009";
                            break;
                        case "3TD":
                            i = "\u4e09\u540c\u53f7\u5355\u9009", s = 1;
                            break;
                        case "2TF":
                            i = "\u4e8c\u540c\u53f7\u590d\u9009", s = 1;
                            break;
                        case "2TD":
                            i = "\u4e8c\u540c\u53f7\u5355\u9009", s = 1;
                            break;
                        case "3LT":
                            i = "\u4e09\u8fde\u53f7\u901a\u9009", s = 1, o = "\u4e09\u8fde\u53f7\u901a\u9009";
                            break;
                        case "HSZ":
                            i = "\u548c\u503c", s = o.split(",").length;
                            break;
                        case "3BT":
                        case "2BT":
                            c = o.length * 1, d = ["\u4e8c\u4e0d\u540c\u53f7", "\u4e09\u4e0d\u540c\u53f7"], v = ["\u5355\u5f0f", "\u80c6\u62d6", "\u590d\u5f0f"], d = d[f.charAt(0) * 1 - 2];
                            if (o.indexOf("$") > 0) {
                                var b = o.indexOf("$");
                                if (f == "2BT" || f == "3BT" && b == 2) s = o.length - b - 1;
                                else if (f == "3BT" && b == 1) {
                                    var y = o.length - b - 1;
                                    y *= y - 1, y /= 2, y % 2 != 0 && (s = 0), s = y
                                }
                                v = f.charAt(0) * 1 == c ? v[0] : v[1], l = f.charAt(0)
                            } else {
                                v = f.charAt(0) * 1 == c ? v[0] : v[2], l = f.charAt(0);
                                for (var m = 1; m <= l; m++) h *= c, c--, p *= m;
                                if (h % p != 0) return;
                                s = h / p
                            }
                            i = d + v
                    }
                    t.pages.d_count = s;
                    break;
                case "265108":
                    var l = 0,
                        c, h = 1,
                        p = 1,
                        d, v;
                    s = 1, a = n.split("|"), f = a[0], o = a[1], l = f.charAt(1) * 1;
                    if (o.indexOf(",") > -1) {
                        o = o.split(","), c = [];
                        for (var m = 0; m < o.length; m++) c[m] = o[m].split(" ").length * 1
                    } else c = o.split(" ").length * 1;
                    if (f.indexOf("R") > -1) {
                        d = ["\u4efb\u4e00", "\u4efb\u4e8c", "\u4efb\u4e09", "\u4efb\u56db", "\u4efb\u4e94", "\u4efb\u516d", "\u4efb\u4e03", "\u4efb\u516b", "\u4efb\u4e5d", "\u4efb\u5341"], v = ["\u5355\u5f0f", "\u590d\u5f0f"], f.charAt(1) == "A" && c == 10 ? (v = v[0], d = d[9]) : f.charAt(1) == "A" && c > 10 ? (v = v[1], d = d[9]) : (d = d[l - 1], v = l == c ? v[0] : v[1]);
                        for (var m = 1; m <= l; m++) h *= c, c--, p *= m;
                        h % p != 0 ? s = 1 : s = h / p, i = d + v
                    }
                    t.pages.d_count = s;
                    break;
                case "166407":
                    var l = 0,
                        c, h = 1,
                        p = 1,
                        d, v;
                    s = 1, a = n.split("|"), f = a[0], o = a[1];
                    switch (f) {
                        case "DD":
                            i = "\u5bf9\u5b50\u5355\u9009", s = o.split(",").length;
                            break;
                        case "DB":
                            i = "\u5bf9\u5b50\u5305\u9009", s = 1, o = "\u5305\u9009";
                            break;
                        case "BD":
                            i = "\u8c79\u5b50\u5355\u9009", s = o.split(",").length;
                            break;
                        case "BB":
                            i = "\u8c79\u5b50\u5305\u9009", s = 1, o = "\u5305\u9009";
                            break;
                        case "SD":
                            i = "\u987a\u5b50\u5355\u9009", s = o.split(",").length;
                            break;
                        case "SB":
                            i = "\u987a\u5b50\u5305\u9009", s = 1, o = "\u5305\u9009";
                            break;
                        case "TD":
                            i = "\u540c\u82b1\u987a\u5355\u9009", s = 1;
                            switch (o) {
                                case "111":
                                    o = "\u9ed1\u6843";
                                    break;
                                case "222":
                                    o = "\u7ea2\u6843";
                                    break;
                                case "333":
                                    o = "\u6885\u82b1";
                                    break;
                                case "444":
                                    o = "\u65b9\u5757"
                            }
                            break;
                        case "TB":
                            i = "\u540c\u82b1\u987a\u5305\u9009", s = 1, o = "\u5305\u9009";
                            break;
                        case "HD":
                            i = "\u540c\u82b1\u5355\u9009", s = 1;
                            switch (o) {
                                case "111":
                                    o = "\u9ed1\u6843";
                                    break;
                                case "222":
                                    o = "\u7ea2\u6843";
                                    break;
                                case "333":
                                    o = "\u6885\u82b1";
                                    break;
                                case "444":
                                    o = "\u65b9\u5757"
                            }
                            break;
                        case "HB":
                            i = "\u540c\u82b1\u5305\u9009", s = 1, o = "\u5305\u9009";
                            break;
                        default:
                            l = f.charAt(1) * 1;
                            var S = l - 1;
                            c = o.length * 1;
                            if (f.indexOf("R") > -1) {
                                d = ["\u4efb\u4e00", "\u4efb\u4e8c", "\u4efb\u4e09", "\u4efb\u56db", "\u4efb\u4e94", "\u4efb\u516d"], v = ["\u5355\u5f0f", "\u590d\u5f0f", "\u80c6\u62d6"];
                                var x = o.indexOf("$");
                                x > -1 ? (v = v[2], l -= x, c = c - x - 1) : v = l == c ? v[0] : v[1];
                                for (var m = 1; m <= l; m++) h *= c, c--, p *= m;
                                h % p != 0 ? s = 1 : s = h / p, i = d[S] + v
                            }
                            o.indexOf("0") > -1 && (o = o.replace(/0/, "10"))
                    }
                    t.pages.d_count = s
            }
            return {
                plays: i,
                count: s,
                money: s * 2,
                code: n,
                red: o
            }
        }
    }
})();
(function () {
    "use strict";
    var e = window.jQuery,
		t = window.qh360cp,
		n = window._;
    t.pages.zh = {}, t.pages.zh.init = function () {
        e("#zh_all_issue").on("click", function () {
            var n = e("#zh_set_mul").val(),
				r = e.trim(e("#count").text()),
				i = e(this).prop("checked"),
				s = e("#zh_list").find("input[name=zh_issue]"),
				o = i ? n * t.pages.price * r : 0,
				u = i ? s.length : 0;
            s.each(function () {
                var t = e(this),
					r = t.parents("tr");
                t.prop("checked", i), r.find("input[name=zh_mul]").val(i ? n : ""), r.find(".s3 b").text(o)
            }), e("#zh_total b").eq(0).text(u), e("#zh_total b").eq(1).text(u * o)
        }), e("#zh_tips").hover(function () {
            var n = "<span>\u4e2d\u5956\u505c\u8ffd\uff1a</span>\u52fe\u9009\u540e\uff0c\u60a8\u7684\u8ffd\u53f7\u65b9\u6848\u4e2d\u7684\u67d0\u4e00\u671f\u4e2d\u5956" + (t.pages.zh_stop_money > 0 ? "\u91d1\u989d\u5927\u4e8e\u60a8\u8bbe\u5b9a\u7684\u91d1\u989d" : "");
            n += "\u540e\uff0c\u540e\u7eed\u7684\u8ffd\u53f7\u8ba2\u5355\u5c06\u88ab\u64a4\u9500\uff0c\u8d44\u91d1\u8fd4\u8fd8\u60a8\u7684\u8d26\u6237\u4e2d\u3002\u5982\u4e0d\u52fe\u9009\uff0c\u7cfb\u7edf\u4e00\u76f4\u5e2e\u60a8\u8d2d\u4e70\u6240\u6709\u7684\u8ffd\u53f7\u6295\u6ce8\u4efb\u52a1\u3002", t.lightbox.tips_tmp = t.lightbox.tips({
                offset_box: e(this),
                width: 260,
                content: n
            })
        }, function () {
            t.lightbox.tips_tmp.close()
        }), e("#zh_issue_list").on("change", function () {
            t.pages.get_buy_type() == "trace" && t.pages.zh.get_issue_list(e(this).val())
        }), e("#zh_set_mul").on("keyup blur", function (n) {
            var r = ("0" + e(this).val().replace(/\D/g, "")) * 1;
            r > t.pages.max_mul && (r = t.pages.max_mul), n.type == "blur" && (r = r || 1), e("#mul").val(r).trigger("blur")
        }), e("#zh_list").on("click", "input[name=zh_issue]", function (n) {
            var r = e(this).prop("checked"),
				i = e(this).parents("tr"),
				s = i.find("input[name=zh_mul]"),
				o = i.find(".s3 b"),
				u = e("#zh_set_mul").val(),
				a = s.val(),
				f = e.trim(e("#count").text()),
				l = e("#zh_total b"),
				c = l.eq(0).text() * 1,
				h = l.eq(1).text() * 1;
            s.val(r ? u : ""), o.text(r ? u * t.pages.price * f : 0), l.eq(0).text(r ? c + 1 : c - 1), l.eq(1).text(r ? h + u * t.pages.price * f : h - a * t.pages.price * f)
        }), e("#zh_list").on("focus", "input[name=zh_mul]", function (t) {
            e(this).data("pre_mul", e(this).val() || 0)
        }).on("keyup blur", "input[name=zh_mul]", function (n) {
            var r = e(this),
				i = r.parents("tr"),
				s = i.find("input[name=zh_issue]"),
				o = i.find(".s3 b"),
				u = e("#zh_total b"),
				a = r.data("pre_mul") * 1,
				f = ("0" + r.val().replace(/\D/g, "")) * 1,
				l = e("#zh_set_mul").val();
            f > t.pages.max_mul && (f = t.pages.max_mul);
            var c = e.trim(e("#count").text()),
				h = u.eq(0).text() * 1,
				p = u.eq(1).text() * 1,
				d = c * t.pages.price;
            s.prop("checked", f), o.text(d * f), u.eq(0).text(e("#zh_list input[name=zh_issue]:checked").length), u.eq(1).text(p + (f - a) * d), r.data("pre_mul", f || 0).val(f || 0)
        }), e("#zh_stop_trace").on("click", function () {
            e("#zh_stop_money").prop("disabled", !e(this).prop("checked"))
        }), e("#zh_stop_money").on("keyup blur", function (t) {
            var n = ("0" + e(this).val().replace(/\D/g, "")) * 1;
            e(this).val(n)
        }).val(t.pages.zh_stop_money);
        if (t.pages.zh_stop_money) {
            var n = e(".zh_stop_type");
            n.eq(0).hide(), n.eq(1).show()
        }
        e("#mul").trigger("blur")
    }, t.pages.zh.create_zh_list = function () {
        if (t.pages.get_buy_type() != "trace") return;
        if (t.pages.zh.get_issue_list_count) {
            var n = e("#zh_list input[name=zh_issue]").val();
            n != t.pages.issue ? t.pages.zh.get_issue_list() : t.pages.zh.get_issue_list_callback()
        } else t.pages.zh.get_issue_list()
    }, t.pages.zh.get_issue_list = function (e) {
        e = e || t.pages.zh.get_issue_list_count || 10, t.lottery.get_issue_list({
            callback: function (n) {
                t.pages.zh.get_issue_list_data = n, t.pages.zh.get_issue_list_count = e, t.pages.zh.get_issue_list_callback()
            },
            count: e
        })
    }, t.pages.zh.get_issue_list_callback = function () {
        var n = t.pages.zh.get_issue_list_data || {};
        if (n.xCode == "0") {
            e("#zh_all").prop("checked", 1);
            var r = n.xValue.split("_"),
				i = r.length,
				s = e("#zh_set_mul").val(),
				o = e.trim(e("#count").text()),
				u = s * t.pages.price * o,
				a = [];
            for (var f = 0; f < i; f++) {
                var l = r[f].split("=");
                a.push('<tr><td class="s0">' + (f + 1) + "</td>"), a.push('<td class="s1"><label><input class="checkbox" checked="checked" autocomplete="off" name="zh_issue" value="' + l[0] + '" type="checkbox"> <span>\u7b2c' + l[0] + "\u671f " + (f ? "" : '<em class="em">\u5f53\u524d\u671f</em>') + "</span></label></td>"), a.push('<td class="s2"><input type="text" autocomplete="off" value="' + s + '" name="zh_mul" class="text"> \u500d</td>'), a.push('<td class="s3"><b class="em">' + u + "</b> \u5143</td>"), a.push('<td class="s4">' + l[1] + "</td></tr>")
            }
            e("#zh_list").html(a.join("")), e("#zh_total b").eq(0).text(i), e("#zh_total b").eq(1).text(u * i), e("#zh_all_issue").prop("checked", 1)
        }
    }, t.pages.zh.reset = function () {
        e("#zh_set_mul").val(e("#mul").val()), t.pages.zh.create_zh_list()
    }, t.pages.zh.param = function () {
        var n = e.trim(e("#count").text()),
			r = e("#mul").val(),
			i = n * t.pages.price,
			s = e("#zh_list input[name=zh_issue]:checked"),
			o = s.length,
			u = e.trim(e("#zh_total b").eq(1).text()),
			a = e.map(s, function (t, n) {
			    return e(t).val() + "=" + e(t).parents("tr").find("input[name=zh_mul]").val()
			}),
			f = e("#zh_stop_trace").prop("checked") ? e("#zh_stop_money").val() : "999999999",
			l = {
			    buy_type: "trace",
			    ChipCount: n,
			    ChipMoney: i,
			    StartDrawNo: s.eq(0).val(),
			    EndDrawNo: s.last().val(),
			    TraceCount: o,
			    TotalMoney: u,
			    StopBonus: f,
			    ChipMulStr: a.join(",")
			};
        return l
    }
})();
(function () {
    "use strict";
    var e = window.jQuery,
		t = window.qh360cp,
		n = window._;
    t.pages.znzh = {
        config: {
            tpl: '<tr><td width="6%">{6}</td><td width="25%" class={8}><span><input type="hidden" name="expect" value="{7}">{0}</span></td><td ><input type="hidden" name="beishu" value=""><span>{1}</span></td><td width="14%"><em>{2}</em></td><td width="14%"><em>{3}</em></td><td width="15%"><em>{4}</em></td><td width="14%"><em>{5}</em></td></tr>',
            perZhu: "#count",
            sTotal: ".user-in",
            rangeSel: ".rangeSel",
            sMul: ".sMul",
            bonus: function () { },
            issueLen: ".issueLen",
            minRate: ".minRate",
            preIssue: ".preIssue",
            preRate: ".preRate",
            nextRate: ".nextRate",
            minus: ".minus",
            makeSel: ".makeSel",
            clearSel: ".clearSel",
            mulMax: lott_info.max_mul || 9999999,
            typeSel: ":radio[name=znzh_bm]",
            singleBouns: ".singleBouns",
            curIssueSel: ".cz-name em",
            dstSel: "#zzhlist",
            numSel: ".znzh-count",
            moneySel: ".znzh-money"
        },
        url: "/int/qissuelist?"
    }, t.pages.znzh.init = function (n) {
        var r = t.pages.znzh.config;
        if (!r || typeof n != "function") return !1;
        r.bonus = n;
        var i = [r.sTotal, r.preRate, r.nextRate, r.minus, r.singleBouns].join(",");
        e(i).on("keyup", function () {
            var t = e(this),
				n = 0;
            n = [].concat(t.val().match(/\d+/g))[0], t.val(n)
        }), e(i).on("blur", function (t) {
            var n = e(this),
				r = 0;
            r = [].concat(n.val().match(/\d+/g))[0] * 1;
            if (n.data("bonus")) {
                var i = n.data("bonus") * 1;
                r < i && n.val(i)
            } else r = Math.max(r, 0), n.val(r)
        }), i = [r.sMul, r.issueLen, r.minRate, r.preIssue].join(","), e(i).on("keyup", function () {
            var t = e(this),
				n = 1;
            n = [].concat(t.val().match(/\d+/g))[0], t.val(n)
        }), e(i).not(r.sMul).on("blur", function () {
            var t = e(this),
				n = 1;
            n = [].concat(t.val().match(/\d+/g))[0] * 1, n = Math.max(n, 1), t.val(n)
        }), e(r.sMul).on("blur", function () {
            var t = e(this),
				n = 1;
            n = [].concat(t.val().match(/\d+/g))[0] * 1, n = Math.max(n, 1), n = Math.min(n, r.mulMax), t.val(n)
        }), e(r.typeSel).on("change", function () {
            var t = e(this),
				n = t.parents("p");
            e(r.typeSel).parents("p").attr("class", "dissel").find(":text").attr("disabled", "disabled"), n.attr("class", "").find(":text").removeAttr("disabled")
        }), e(r.makeSel).on("click", function (e) {
            e.preventDefault(), t.pages.znzh.query()
        }), e(r.clearSel).click(function (t) {
            t.preventDefault();
            var n = [r.sTotal, r.preRate, r.nextRate, r.minus, r.sMul, r.issueLen, r.minRate, r.preIssue].join(",");
            e(n).val("")
        }), e(".stopBonus").on("mouseover", ".ico", function () {
            var n = e(this).attr("val"),
				r = "<span>\u4e2d\u5956\u505c\u8ffd\uff1a</span>\u52fe\u9009\u540e\uff0c\u60a8\u7684\u8ffd\u53f7\u65b9\u6848\u4e2d\u7684\u67d0\u4e00\u671f\u4e2d\u5956\u540e\uff0c\u540e\u7eed\u7684\u8ffd\u53f7\u8ba2\u5355\u5c06\u88ab\u64a4\u9500\uff0c\u8d44\u91d1\u8fd4\u8fd8\u60a8\u7684\u8d26\u6237\u4e2d\u3002\u5982\u4e0d\u52fe\u9009\uff0c\u7cfb\u7edf\u4e00\u76f4\u5e2e\u60a8\u8d2d\u4e70\u6240\u6709\u7684\u8ffd\u53f7\u6295\u6ce8\u4efb\u52a1";
            t.lightbox.tips_tmp = t.lightbox.tips({
                offset_box: e(this),
                content: r,
                width: 260,
                left: -30
            })
        }).on("mouseout", ".ico", function () {
            t.lightbox.tips_tmp.close()
        }), e("#znzh_issue_select").change(function () {
            if (typeof r.bonus == "function") {
                var n = t.pages.znzh.getCurplay()[1],
					i = r.bonus(n ? n : "", this.value);
                e(r.singleBouns).val(i).data("bonus", i)
            }
            return !1
        })
    }, t.pages.znzh.query = function () {
        var n = e(t.pages.znzh.config.issueLen).val() * 1;
        if (n < 1) return t.lightBox.alert({
            content: "\u8bf7\u586b\u5199\u8ffd\u53f7\u7684\u671f\u6570\uff01"
        }), !1;
        var r = t.pages.znzh.getCurplay();
        if (r[0] < 1) return t.lightBox.alert({
            content: "\u8bf7\u5148\u9009\u53d6\u6295\u6ce8\u53f7\u7801\uff01"
        }), !1;
        if (r[0] > 1) return t.lightBox.alert({
            content: "\u667a\u80fd\u8ffd\u53f7\u53ea\u9002\u7528\u4e8e\u5355\u6ce8\u53f7\u7801"
        }), !1;
        var i = {
            LotID: window.lott_info.lott_type_id || "258001",
            IssueCount: n,
            BeginIssue: e(t.pages.znzh.config.rangeSel).val() * 1,
            r: Math.random()
        },
			s = t.pages.znzh.url + e.param(i);
        e.getJSON(s, function (e) {
            if (e.xCode && e.xCode == "0") {
                var n = e.xValue.replace(/(=\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})/g, "").split("_"),
					r = t.pages.znzh.getCurplay()[1];
                r ? t.pages.znzh.makeRecord(n, r) : t.lightBox.alert({
                    content: "\u8bf7\u5148\u9009\u53d6\u6295\u6ce8\u53f7\u7801\uff01"
                })
            } else t.pages.znzh.query()
        })
    }, t.pages.znzh.getCurplay = function () {
        var n = e(".codelist li"),
			r = [n.length];
        return r[1] = r[0] ? n.attr("codes").split("|")[0] : "", r[0] != 1 && (e("#zzhlist").html('<tr><td style="height: 70px;line-height: 70px;" colspan="7">\u6682\u65e0\u751f\u6210\u8ffd\u53f7</td></tr>'), e(t.pages.znzh.config.numSel).text(0), e(t.pages.znzh.config.moneySel).text(0)), r[2] = e(".codelist li:eq(0)").find(".code b:eq(0)").text(), r[2] == "\u4e09\u661f\u7ec4\u516d" && (r[1] = "Z6"), r
    }, t.pages.znzh.makeRecord = function (n, u) {
        var a = t.pages.znzh.config,
			f = {
			    sTotal: e(a.sTotal).val() * 1,
			    sMul: e(a.sMul).val() * 1,
			    perMoney: 2,
			    perZhu: e(a.perZhu).text() * 1 || 1,
			    issueLen: e(a.issueLen).val() * 1,
			    bonus: a.bonus,
			    issues: n,
			    mulMax: a.mulMax,
			    play: u
			};
        if (f.perZhu < 1) return t.lightBox.alert({
            content: "\u8bf7\u81f3\u5c11\u9009\u62e91\u6ce8\u53f7\u7801\uff01"
        }), !1;
        if (f.sMul < 1) return t.lightBox.alert({
            content: "\u8bf7\u586b\u5199\u8d77\u59cb\u500d\u6570\uff01"
        }), !1;
        var l = e(a.typeSel + ":checked").attr("val"),
			c = {},
			h = "";
        switch (l) {
            case "minRate":
                f.minRate = e(a.minRate).val() * 1;
                if (f.minRate < 1) return t.lightBox.alert({
                    content: "\u8bf7\u586b\u5199\u6700\u4f4e\u76c8\u5229\u7387\uff01"
                }), !1;
                c = r(f);
                break;
            case "sepRate":
                f.preIssue = e(a.preIssue).val() * 1, f.preRate = e(a.preRate).val() * 1, f.nextRate = e(a.nextRate).val() * 1;
                if (!(f.preIssue && f.preRate && f.nextRate)) return t.lightBox.alert({
                    content: "\u53c2\u6570\u4e0d\u5b8c\u6574\uff0c\u8bf7\u68c0\u67e5\uff01"
                }), !1;
                c = i(f);
                break;
            case "minus":
                f.minus = e(a.minus).val() * 1;
                if (f.minus < 1) return t.lightBox.alert({
                    content: "\u8bf7\u586b\u5199\u6700\u4f4e\u76c8\u5229\u91d1\u989d\uff01"
                }), !1;
                c = s(f)
        }
        if (c.result.length < 1) return t.lightBox.alert({
            content: c.info_txt
        }), !1;
        c.result.length > 10 ? (e("#zzhlist").parents(".bd").addClass("zzhlist-scroll"), e("#zzhlist").parent().css("_width", "97%")) : (e("#zzhlist").parents(".bd").removeClass("zzhlist-scroll"), e("#zzhlist").parent().css("_width", "100%")), c.issues - e(t.pages.znzh.config.issueLen).val() < 0 && t.lightBox.alert({
            content: c.info_txt
        }), e(a.numSel).text(c.issues), e(a.moneySel).text(c.money), e(a.dstSel).html(o(a.tpl, c.result)), typeof t.pages.znzh.callback == "function" && t.pages.znzh.callback.call(null)
    }, t.pages.znzh.updateIssue = function () {
        if (typeof t.pages.znzh.config.bonus == "function") {
            var n = t.pages.znzh.getCurplay()[1],
				r = t.pages.znzh.config.bonus(n ? n : "", e("#znzh_issue_select").val());
            e(t.pages.znzh.config.singleBouns).val(r).data("bonus", r)
        }
        if (t.pages.get_buy_type() != "zntrace" || e("#znzh_issue_select").val() == t.pages.issue) return;
        var i = {
            LotID: window.lott_info.lott_type_id || "258001",
            IssueCount: 10,
            BeginIssue: e(t.pages.znzh.config.curIssueSel).text(),
            r: Math.random()
        },
			s = t.pages.znzh.url + e.param(i);
        e.getJSON(s, function (n) {
            if (n.xCode && n.xCode == "0") {
                var r = n.xValue.replace(/(=\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})/g, "").split("_"),
					i = [];
                for (var s = 0, o = r.length; s < o; s++) i.push('<option value="' + r[s] + '">' + r[s] + "</option>");
                e(t.pages.znzh.config.rangeSel).html(i.join(""));
                if (typeof t.pages.znzh.config.bonus == "function") {
                    var u = t.pages.znzh.getCurplay()[1],
						a = t.pages.znzh.config.bonus(u ? u : "", e("#znzh_issue_select").val());
                    e(t.pages.znzh.config.singleBouns).val(a).data("bonus", a)
                }
            } else t.pages.znzh.updateIssue()
        })
    };
    var r = function (n) {
        var r = n.sTotal || 0,
            i = n.sMul,
            s = n.perMoney,
            o = n.perZhu,
            u = n.issues,
            a = u.length,
            f = n.minRate / 100,
            l = 0,
            c = i,
            h = 0,
            p = 0,
            d = [],
            v, m = n.bonus,
            g = n.mulMax,
            y, b, w = e.trim(e(t.pages.znzh.config.curIssueSel).text());
        v = Math.max(m.call(this, n.play, u[0]), e(t.pages.znzh.config.singleBouns).val() * 1);
        var E = Math.floor((c * v - r - s * o * c) / (r + s * o * c) * 100);
        for (var S = 0; S < a; S++) {
            v = Math.max(m.call(this, n.play, u[S]), e(t.pages.znzh.config.singleBouns).val() * 1);
            for (var x = c; x < g; x++) {
                l = s * o * x, h = x * v - r - l, p = h / (r + l);
                if (p - f >= 0) {
                    r += l, c = x;
                    if (r > 1e6) return {
                        result: [].concat(d),
                        issues: d.length,
                        money: r - n.sTotal - l,
                        info_txt: "\u6295\u6ce8\u91d1\u989d\u5df2\u8fc7\u767e\u4e07\uff0c\u7cfb\u7edf\u4e0d\u518d\u8ba1\u7b97\uff01<br>\u5efa\u8bae\u964d\u4f4e\u76c8\u5229\u7387\u8bbe\u7f6e"
                    };
                    y = u[S] - w == 0 ? u[S] + "<em>&nbsp;[\u5f53\u524d\u671f]</em>" : u[S], b = u[S] - w == 0 ? "znzh_cur_issue" : "znzh_issue", d.push([y, x, l, r, h, Math.floor(p * 100) + "%", S + 1, u[S], b]);
                    break
                }
                if (x == g - 1 && p - f < 0) return {
                    result: [].concat(d),
                    issues: d.length,
                    money: r - n.sTotal,
                    info_txt: d.length ? "\u76c8\u5229\u7387\u8bbe\u7f6e\u8fc7\u5927\uff0c\u65b9\u6848\u53ea\u80fd\u751f\u6210" + d.length + "\u671f" : "\u76c8\u5229\u7387\u8bbe\u7f6e\u8fc7\u5927\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e<br>(\u6b64\u65b9\u6848\u6700\u5927\u76c8\u5229\u7387\uff1a" + E + "%)",
                    mul: x
                }
            }
        }
        var T = {
            result: [].concat(d),
            issues: a,
            money: r - n.sTotal,
            info_txt: d.length == a ? "\u5f53\u524d\u53ef\u8ffd\u671f\u6570\u4ec5" + a + "\u671f" : "\u500d\u6570\u8bbe\u7f6e\u8fc7\u5927\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e<br>\u6700\u5927\u652f\u6301" + t.pages.znzh.config.mulMax + "\u500d",
            mul: x
        };
        return T
    },
		i = function (n) {
		    var r = n.sTotal || 0,
				i = n.sMul,
				s = n.perMoney,
				o = n.perZhu,
				u = n.issues,
				a = u.length,
				f, l = n.preIssue,
				c = 0,
				h = i,
				p = 0,
				d = 0,
				v = [],
				m, g = n.bonus,
				y = n.mulMax,
				b, w, E = e.trim(e(t.pages.znzh.config.curIssueSel).text());
		    m = Math.max(g.call(this, n.play, u[0]), e(t.pages.znzh.config.singleBouns).val() * 1);
		    var S = Math.floor((h * m - r - s * o * h) / (r + s * o * h) * 100);
		    for (var x = 0; x < a; x++) {
		        x == l && (h = 1), m = Math.max(g.call(this, n.play, u[x]), e(t.pages.znzh.config.singleBouns).val() * 1);
		        for (var T = h; T < y; T++) {
		            c = s * o * T, p = T * m - r - c, d = p / (r + c), f = x < l ? n.preRate / 100 : n.nextRate / 100;
		            if (d - f >= 0) {
		                r += c, h = T;
		                if (r > 1e6) return {
		                    result: [].concat(v),
		                    issues: v.length,
		                    money: r - n.sTotal - c,
		                    info_txt: "\u6295\u5165\u5df2\u8fc7\u767e\u4e07\uff0c\u7cfb\u7edf\u4e0d\u518d\u8ba1\u7b97\uff01<br>\u5efa\u8bae\u964d\u4f4e\u76c8\u5229\u7387\u8bbe\u7f6e"
		                };
		                b = u[x] - E == 0 ? u[x] + "<em>&nbsp;[\u5f53\u524d\u671f]</em>" : u[x], w = u[x] - E == 0 ? "znzh_cur_issue" : "znzh_issue", v.push([b, T, c, r, p, Math.floor(d * 100) + "%", x + 1, u[x], w]);
		                break
		            }
		            if (T == y - 1 && d - f < 0) return {
		                result: [].concat(v),
		                issues: v.length,
		                money: r - n.sTotal,
		                info_txt: v.length ? "\u76c8\u5229\u7387\u8bbe\u7f6e\u8fc7\u5927\uff0c\u65b9\u6848\u53ea\u80fd\u751f\u6210" + v.length + "\u671f" : "\u76c8\u5229\u7387\u8bbe\u7f6e\u8fc7\u5927\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e<br>(\u6b64\u65b9\u6848\u6700\u5927\u76c8\u5229\u7387\uff1a" + S + "%)",
		                mul: T
		            }
		        }
		    }
		    var N = {
		        result: [].concat(v),
		        issues: a,
		        money: r - n.sTotal,
		        info_txt: v.length == a ? "\u5f53\u524d\u53ef\u8ffd\u671f\u6570\u4ec5" + a + "\u671f" : "\u500d\u6570\u8bbe\u7f6e\u8fc7\u5927\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e<br>\u6700\u5927\u652f\u6301" + t.pages.znzh.config.mulMax + "\u500d",
		        mul: T
		    };
		    return N
		},
		s = function (n) {
		    var r = n.sTotal || 0,
				i = n.sMul,
				s = n.perMoney,
				o = n.perZhu,
				u = n.issues,
				a = u.length,
				f = n.minus,
				l = 0,
				c = i,
				h = 0,
				p = 0,
				d = [],
				v, m = n.bonus,
				g = n.mulMax,
				y, b, w = e.trim(e(t.pages.znzh.config.curIssueSel).text());
		    for (var E = 0; E < a; E++) {
		        v = Math.max(m.call(this, n.play, u[E]), e(t.pages.znzh.config.singleBouns).val() * 1);
		        for (var S = c; S < g; S++) {
		            l = s * o * S, h = S * v - r - l, p = h / (r + l);
		            if (h - f >= 0) {
		                r += l, c = S;
		                if (r > 1e6) return {
		                    result: [].concat(d),
		                    issues: d.length,
		                    money: r - n.sTotal - l,
		                    info_txt: "\u6295\u5165\u5df2\u8fc7\u767e\u4e07\uff0c\u7cfb\u7edf\u4e0d\u518d\u8ba1\u7b97\uff01<br>\u5efa\u8bae\u964d\u4f4e\u76c8\u5229\u7387\u8bbe\u7f6e"
		                };
		                y = u[E] - w == 0 ? u[E] + "<em>&nbsp;[\u5f53\u524d\u671f]</em>" : u[E], b = u[E] - w == 0 ? "znzh_cur_issue" : "znzh_issue", d.push([y, S, l, r, h, Math.floor(p * 100) + "%", E + 1, u[E], b]);
		                break
		            }
		            if (S == g - 1 && h - f < 0) return {
		                result: [].concat(d),
		                issues: d.length,
		                money: r - n.sTotal,
		                info_txt: d.length ? "\u76c8\u5229\u7387\u8bbe\u7f6e\u8fc7\u5927\uff0c\u65b9\u6848\u53ea\u80fd\u751f\u6210" + d.length + "\u671f" : "\u76c8\u5229\u91d1\u989d\u8bbe\u7f6e\u8fc7\u5927\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e",
		                mul: S
		            }
		        }
		    }
		    var x = {
		        result: [].concat(d),
		        issues: a,
		        money: r - n.sTotal,
		        info_txt: d.length == a ? "\u5f53\u524d\u53ef\u8ffd\u671f\u6570\u4ec5" + a + "\u671f" : "\u500d\u6570\u8bbe\u7f6e\u8fc7\u5927\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e<br>\u6700\u5927\u652f\u6301" + t.pages.znzh.config.mulMax + "\u500d",
		        mul: S
		    };
		    return x
		},
		o = function (e, t) {
		    var n = "",
				r = null,
				i = "";
		    for (var s = 0, o = 0, u, a = t.length; s < a; s++) {
		        n = e;
		        for (o = 0, u = t[s].length; o < u; o++) r = new RegExp("\\{" + o + "\\}", "g"), n = n.replace(r, t[s][o]);
		        i += n
		    }
		    return i
		};
    t.pages.znzh.param = function () {
        var n = e.trim(e("#count").text()),
			r = e("#mul").val(),
			i = n * t.pages.price,
			s = e("#zh_list input[name=zh_issue]:checked"),
			o = s.length,
			u = e.trim(e(t.pages.znzh.config.moneySel).text()) * 1,
			a = [],
			f = t.pages.znzh.config;
        e(f.dstSel + " tr").each(function (t, n) {
            var r = e(n).find("td");
            a.push(r.eq(1).text().match(/\d+/g) + "=" + r.eq(2).text())
        });
        var l = e(".zh_stop_zntrace").prop("checked") ? 0 : "999999999",
			c = e(f.dstSel + " tr").length,
			h = {
			    buy_type: "trace",
			    ChipCount: n,
			    ChipMoney: i,
			    StartDrawNo: u < 1 ? lott_info.issue : e(f.dstSel + " tr:first td:eq(1)").text().match(/\d+/g)[0],
			    EndDrawNo: u < 1 ? lott_info.issue : e(f.dstSel + " tr:last td:eq(1)").text(),
			    TraceCount: c,
			    TotalMoney: u,
			    StopBonus: l,
			    ChipMulStr: a.join(",")
			};
        return h
    }, t.pages.znzh.reset = function () {
        t.pages.znzh.updateIssue(), e("#zzhlist").html('<tr><td style="height: 70px;line-height: 70px;" colspan="7">\u6682\u65e0\u751f\u6210\u8ffd\u53f7</td></td>'), e(t.pages.znzh.config.numSel).text(0), e(t.pages.znzh.config.moneySel).text(0)
    }
})();
(function (e) {
    var t = "0.4.2",
		n = "hasOwnProperty",
		r = /[\.\/]/,
		i = "*",
		s = function () { },
		o = function (e, t) {
		    return e - t
		},
		u, a, f = {
		    n: {}
		},
		l = function (e, t) {
		    e = String(e);
		    var n = f,
				r = a,
				i = Array.prototype.slice.call(arguments, 2),
				s = l.listeners(e),
				c = 0,
				h = !1,
				p, d = [],
				v = {},
				m = [],
				g = u,
				y = [];
		    u = e, a = 0;
		    for (var b = 0, w = s.length; b < w; b++) "zIndex" in s[b] && (d.push(s[b].zIndex), s[b].zIndex < 0 && (v[s[b].zIndex] = s[b]));
		    d.sort(o);
		    while (d[c] < 0) {
		        p = v[d[c++]], m.push(p.apply(t, i));
		        if (a) return a = r, m
		    }
		    for (b = 0; b < w; b++) {
		        p = s[b];
		        if ("zIndex" in p) if (p.zIndex == d[c]) {
		            m.push(p.apply(t, i));
		            if (a) break;
		            do {
		                c++, p = v[d[c]], p && m.push(p.apply(t, i));
		                if (a) break
		            } while (p)
		        } else v[p.zIndex] = p;
		        else {
		            m.push(p.apply(t, i));
		            if (a) break
		        }
		    }
		    return a = r, u = g, m.length ? m : null
		};
    l._events = f, l.listeners = function (e) {
        var t = e.split(r),
			n = f,
			s, o, u, a, l, c, h, p, d = [n],
			v = [];
        for (a = 0, l = t.length; a < l; a++) {
            p = [];
            for (c = 0, h = d.length; c < h; c++) {
                n = d[c].n, o = [n[t[a]], n[i]], u = 2;
                while (u--) s = o[u], s && (p.push(s), v = v.concat(s.f || []))
            }
            d = p
        }
        return v
    }, l.on = function (e, t) {
        e = String(e);
        if (typeof t != "function") return function () { };
        var n = e.split(r),
			i = f;
        for (var o = 0, u = n.length; o < u; o++) i = i.n, i = i.hasOwnProperty(n[o]) && i[n[o]] || (i[n[o]] = {
            n: {}
        });
        i.f = i.f || [];
        for (o = 0, u = i.f.length; o < u; o++) if (i.f[o] == t) return s;
        return i.f.push(t), function (e) {
            +e == +e && (t.zIndex = +e)
        }
    }, l.f = function (e) {
        var t = [].slice.call(arguments, 1);
        return function () {
            l.apply(null, [e, null].concat(t).concat([].slice.call(arguments, 0)))
        }
    }, l.stop = function () {
        a = 1
    }, l.nt = function (e) {
        return e ? (new RegExp("(?:\\.|\\/|^)" + e + "(?:\\.|\\/|$)")).test(u) : u
    }, l.nts = function () {
        return u.split(r)
    }, l.off = l.unbind = function (e, t) {
        if (!e) {
            l._events = f = {
                n: {}
            };
            return
        }
        var s = e.split(r),
			o, u, a, c, h, p, d, v = [f];
        for (c = 0, h = s.length; c < h; c++) for (p = 0; p < v.length; p += a.length - 2) {
            a = [p, 1], o = v[p].n;
            if (s[c] != i) o[s[c]] && a.push(o[s[c]]);
            else for (u in o) o[n](u) && a.push(o[u]);
            v.splice.apply(v, a)
        }
        for (c = 0, h = v.length; c < h; c++) {
            o = v[c];
            while (o.n) {
                if (t) {
                    if (o.f) {
                        for (p = 0, d = o.f.length; p < d; p++) if (o.f[p] == t) {
                            o.f.splice(p, 1);
                            break
                        } !o.f.length && delete o.f
                    }
                    for (u in o.n) if (o.n[n](u) && o.n[u].f) {
                        var m = o.n[u].f;
                        for (p = 0, d = m.length; p < d; p++) if (m[p] == t) {
                            m.splice(p, 1);
                            break
                        } !m.length && delete o.n[u].f
                    }
                } else {
                    delete o.f;
                    for (u in o.n) o.n[n](u) && o.n[u].f && delete o.n[u].f
                }
                o = o.n
            }
        }
    }, l.once = function (e, t) {
        var n = function () {
            return l.unbind(e, n), t.apply(this, arguments)
        };
        return l.on(e, n)
    }, l.version = t, l.toString = function () {
        return "You are running Eve " + t
    }, typeof module != "undefined" && module.exports ? module.exports = l : typeof define != "undefined" ? define("eve", [], function () {
        return l
    }) : e.eve = l
})(this), function () {
    function e(n) {
        if (e.is(n, "function")) return t ? n() : eve.on("raphael.DOMload", n);
        if (e.is(n, O)) return e._engine.create[h](e, n.splice(0, 3 + e.is(n[0], L))).add(n);
        var r = Array.prototype.slice.call(arguments, 0);
        if (e.is(r[r.length - 1], "function")) {
            var i = r.pop();
            return t ? i.call(e._engine.create[h](e, r)) : eve.on("raphael.DOMload", function () {
                i.call(e._engine.create[h](e, r))
            })
        }
        return e._engine.create[h](e, arguments)
    }
    function ht(e) {
        if (Object(e) !== e) return e;
        var t = new e.constructor;
        for (var n in e) e[o](n) && (t[n] = ht(e[n]));
        return t
    }
    function wt(e, t) {
        for (var n = 0, r = e.length; n < r; n++) if (e[n] === t) return e.push(e.splice(n, 1)[0])
    }
    function Et(e, t, n) {
        function r() {
            var i = Array.prototype.slice.call(arguments, 0),
				s = i.join("\u2400"),
				u = r.cache = r.cache || {},
				a = r.count = r.count || [];
            return u[o](s) ? (wt(a, s), n ? n(u[s]) : u[s]) : (a.length >= 1e3 && delete u[a.shift()], a.push(s), u[s] = e[h](t, i), n ? n(u[s]) : u[s])
        }
        return r
    }
    function xt() {
        return this.hex
    }
    function Tt(e, t) {
        var n = [];
        for (var r = 0, i = e.length; i - 2 * !t > r; r += 2) {
            var s = [{
                x: +e[r - 2],
                y: +e[r - 1]
            }, {
                x: +e[r],
                y: +e[r + 1]
            }, {
                x: +e[r + 2],
                y: +e[r + 3]
            }, {
                x: +e[r + 4],
                y: +e[r + 5]
            }];
            t ? r ? i - 4 == r ? s[3] = {
                x: +e[0],
                y: +e[1]
            } : i - 2 == r && (s[2] = {
                x: +e[0],
                y: +e[1]
            }, s[3] = {
                x: +e[2],
                y: +e[3]
            }) : s[0] = {
                x: +e[i - 2],
                y: +e[i - 1]
            } : i - 4 == r ? s[3] = s[2] : r || (s[0] = {
                x: +e[r],
                y: +e[r + 1]
            }), n.push(["C", (-s[0].x + 6 * s[1].x + s[2].x) / 6, (-s[0].y + 6 * s[1].y + s[2].y) / 6, (s[1].x + 6 * s[2].x - s[3].x) / 6, (s[1].y + 6 * s[2].y - s[3].y) / 6, s[2].x, s[2].y])
        }
        return n
    }
    function Ct(e, t, n, r, i) {
        var s = -3 * t + 9 * n - 9 * r + 3 * i,
			o = e * s + 6 * t - 12 * n + 6 * r;
        return e * o - 3 * t + 3 * n
    }
    function kt(e, t, n, r, i, s, o, u, a) {
        a == null && (a = 1), a = a > 1 ? 1 : a < 0 ? 0 : a;
        var f = a / 2,
			l = 12,
			c = [-0.1252, .1252, -0.3678, .3678, -0.5873, .5873, -0.7699, .7699, -0.9041, .9041, -0.9816, .9816],
			h = [.2491, .2491, .2335, .2335, .2032, .2032, .1601, .1601, .1069, .1069, .0472, .0472],
			p = 0;
        for (var d = 0; d < l; d++) {
            var v = f * c[d] + f,
				m = Ct(v, e, n, i, o),
				g = Ct(v, t, r, s, u),
				y = m * m + g * g;
            p += h[d] * S.sqrt(y)
        }
        return f * p
    }
    function Lt(e, t, n, r, i, s, o, u, a) {
        if (a < 0 || kt(e, t, n, r, i, s, o, u) < a) return;
        var f = 1,
			l = f / 2,
			c = f - l,
			h, p = .01;
        h = kt(e, t, n, r, i, s, o, u, c);
        while (N(h - a) > p) l /= 2, c += (h < a ? 1 : -1) * l, h = kt(e, t, n, r, i, s, o, u, c);
        return c
    }
    function At(e, t, n, r, i, s, o, u) {
        if (x(e, n) < T(i, o) || T(e, n) > x(i, o) || x(t, r) < T(s, u) || T(t, r) > x(s, u)) return;
        var a = (e * r - t * n) * (i - o) - (e - n) * (i * u - s * o),
			f = (e * r - t * n) * (s - u) - (t - r) * (i * u - s * o),
			l = (e - n) * (s - u) - (t - r) * (i - o);
        if (!l) return;
        var c = a / l,
			h = f / l,
			p = +c.toFixed(2),
			d = +h.toFixed(2);
        if (p < +T(e, n).toFixed(2) || p > +x(e, n).toFixed(2) || p < +T(i, o).toFixed(2) || p > +x(i, o).toFixed(2) || d < +T(t, r).toFixed(2) || d > +x(t, r).toFixed(2) || d < +T(s, u).toFixed(2) || d > +x(s, u).toFixed(2)) return;
        return {
            x: c,
            y: h
        }
    }
    function Ot(e, t) {
        return _t(e, t)
    }
    function Mt(e, t) {
        return _t(e, t, 1)
    }
    function _t(t, n, r) {
        var i = e.bezierBBox(t),
			s = e.bezierBBox(n);
        if (!e.isBBoxIntersect(i, s)) return r ? 0 : [];
        var o = kt.apply(0, t),
			u = kt.apply(0, n),
			a = ~~(o / 5),
			f = ~~(u / 5),
			l = [],
			c = [],
			h = {},
			p = r ? 0 : [];
        for (var d = 0; d < a + 1; d++) {
            var v = e.findDotsAtSegment.apply(e, t.concat(d / a));
            l.push({
                x: v.x,
                y: v.y,
                t: d / a
            })
        }
        for (d = 0; d < f + 1; d++) v = e.findDotsAtSegment.apply(e, n.concat(d / f)), c.push({
            x: v.x,
            y: v.y,
            t: d / f
        });
        for (d = 0; d < a; d++) for (var m = 0; m < f; m++) {
            var g = l[d],
				y = l[d + 1],
				b = c[m],
				w = c[m + 1],
				E = N(y.x - g.x) < .001 ? "y" : "x",
				S = N(w.x - b.x) < .001 ? "y" : "x",
				x = At(g.x, g.y, y.x, y.y, b.x, b.y, w.x, w.y);
            if (x) {
                if (h[x.x.toFixed(4)] == x.y.toFixed(4)) continue;
                h[x.x.toFixed(4)] = x.y.toFixed(4);
                var T = g.t + N((x[E] - g[E]) / (y[E] - g[E])) * (y.t - g.t),
					C = b.t + N((x[S] - b[S]) / (w[S] - b[S])) * (w.t - b.t);
                T >= 0 && T <= 1 && C >= 0 && C <= 1 && (r ? p++ : p.push({
                    x: x.x,
                    y: x.y,
                    t1: T,
                    t2: C
                }))
            }
        }
        return p
    }
    function Dt(t, n, r) {
        t = e._path2curve(t), n = e._path2curve(n);
        var i, s, o, u, a, f, l, c, h, p, d = r ? 0 : [];
        for (var v = 0, m = t.length; v < m; v++) {
            var g = t[v];
            if (g[0] == "M") i = a = g[1], s = f = g[2];
            else {
                g[0] == "C" ? (h = [i, s].concat(g.slice(1)), i = h[6], s = h[7]) : (h = [i, s, i, s, a, f, a, f], i = a, s = f);
                for (var y = 0, b = n.length; y < b; y++) {
                    var w = n[y];
                    if (w[0] == "M") o = l = w[1], u = c = w[2];
                    else {
                        w[0] == "C" ? (p = [o, u].concat(w.slice(1)), o = p[6], u = p[7]) : (p = [o, u, o, u, l, c, l, c], o = l, u = c);
                        var E = _t(h, p, r);
                        if (r) d += E;
                        else {
                            for (var S = 0, x = E.length; S < x; S++) E[S].segment1 = v, E[S].segment2 = y, E[S].bez1 = h, E[S].bez2 = p;
                            d = d.concat(E)
                        }
                    }
                }
            }
        }
        return d
    }
    function tn(e, t, n, r, i, s) {
        e != null ? (this.a = +e, this.b = +t, this.c = +n, this.d = +r, this.e = +i, this.f = +s) : (this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.e = 0, this.f = 0)
    }
    function mn() {
        return this.x + m + this.y
    }
    function gn() {
        return this.x + m + this.y + m + this.width + " \u00d7 " + this.height
    }
    function An(e, t, n, r, i, s) {
        function h(e) {
            return ((a * e + u) * e + o) * e
        }
        function p(e, t) {
            var n = d(e, t);
            return ((c * n + l) * n + f) * n
        }
        function d(e, t) {
            var n, r, i, s, f, l;
            for (i = e, l = 0; l < 8; l++) {
                s = h(i) - e;
                if (N(s) < t) return i;
                f = (3 * a * i + 2 * u) * i + o;
                if (N(f) < 1e-6) break;
                i -= s / f
            }
            n = 0, r = 1, i = e;
            if (i < n) return n;
            if (i > r) return r;
            while (n < r) {
                s = h(i);
                if (N(s - e) < t) return i;
                e > s ? n = i : r = i, i = (r - n) / 2 + n
            }
            return i
        }
        var o = 3 * t,
			u = 3 * (r - t) - o,
			a = 1 - o - u,
			f = 3 * n,
			l = 3 * (i - n) - f,
			c = 1 - f - l;
        return p(e, 1 / (200 * s))
    }
    function On(e, t) {
        var n = [],
			r = {};
        this.ms = t, this.times = 1;
        if (e) {
            for (var i in e) e[o](i) && (r[U(i)] = e[i], n.push(U(i)));
            n.sort(rt)
        }
        this.anim = r, this.top = n[n.length - 1], this.percents = n
    }
    function Mn(t, r, i, s, u, a) {
        i = U(i);
        var f, l, c, h = [],
			d, v, m, b = t.ms,
			w = {},
			E = {},
			S = {};
        if (s) for (T = 0, N = Nn.length; T < N; T++) {
            var x = Nn[T];
            if (x.el.id == r.id && x.anim == t) {
                x.percent != i ? (Nn.splice(T, 1), c = 1) : l = x, r.attr(x.totalOrigin);
                break
            }
        } else s = +E;
        for (var T = 0, N = t.percents.length; T < N; T++) {
            if (t.percents[T] == i || t.percents[T] > s * t.top) {
                i = t.percents[T], v = t.percents[T - 1] || 0, b = b / t.top * (i - v), d = t.percents[T + 1], f = t.anim[i];
                break
            }
            s && r.attr(t.anim[t.percents[T]])
        }
        if (!f) return;
        if (!l) {
            for (var C in f) if (f[o](C)) if (V[o](C) || r.paper.customAttributes[o](C)) {
                w[C] = r.attr(C), w[C] == null && (w[C] = X[C]), E[C] = f[C];
                switch (V[C]) {
                    case L:
                        S[C] = (E[C] - w[C]) / b;
                        break;
                    case "colour":
                        w[C] = e.getRGB(w[C]);
                        var k = e.getRGB(E[C]);
                        S[C] = {
                            r: (k.r - w[C].r) / b,
                            g: (k.g - w[C].g) / b,
                            b: (k.b - w[C].b) / b
                        };
                        break;
                    case "path":
                        var A = zt(w[C], E[C]),
                            O = A[1];
                        w[C] = A[0], S[C] = [];
                        for (T = 0, N = w[C].length; T < N; T++) {
                            S[C][T] = [0];
                            for (var M = 1, _ = w[C][T].length; M < _; M++) S[C][T][M] = (O[T][M] - w[C][T][M]) / b
                        }
                        break;
                    case "transform":
                        var D = r._,
                            P = en(D[C], E[C]);
                        if (P) {
                            w[C] = P.from, E[C] = P.to, S[C] = [], S[C].real = !0;
                            for (T = 0, N = w[C].length; T < N; T++) {
                                S[C][T] = [w[C][T][0]];
                                for (M = 1, _ = w[C][T].length; M < _; M++) S[C][T][M] = (E[C][T][M] - w[C][T][M]) / b
                            }
                        } else {
                            var H = r.matrix || new tn,
                                B = {
                                    _: {
                                        transform: D.transform
                                    },
                                    getBBox: function () {
                                        return r.getBBox(1)
                                    }
                                };
                            w[C] = [H.a, H.b, H.c, H.d, H.e, H.f], Yt(B, E[C]), E[C] = B._.transform, S[C] = [(B.matrix.a - H.a) / b, (B.matrix.b - H.b) / b, (B.matrix.c - H.c) / b, (B.matrix.d - H.d) / b, (B.matrix.e - H.e) / b, (B.matrix.f - H.f) / b]
                        }
                        break;
                    case "csv":
                        var j = g(f[C])[y](n),
                            F = g(w[C])[y](n);
                        if (C == "clip-rect") {
                            w[C] = F, S[C] = [], T = F.length;
                            while (T--) S[C][T] = (j[T] - w[C][T]) / b
                        }
                        E[C] = j;
                        break;
                    default:
                        j = [][p](f[C]), F = [][p](w[C]), S[C] = [], T = r.paper.customAttributes[C].length;
                        while (T--) S[C][T] = ((j[T] || 0) - (F[T] || 0)) / b
                }
            }
            var q = f.easing,
				R = e.easing_formulas[q];
            if (!R) {
                R = g(q).match(I);
                if (R && R.length == 5) {
                    var z = R;
                    R = function (e) {
                        return An(e, +z[1], +z[2], +z[3], +z[4], b)
                    }
                } else R = st
            }
            m = f.start || t.start || +(new Date), x = {
                anim: t,
                percent: i,
                timestamp: m,
                start: m + (t.del || 0),
                status: 0,
                initstatus: s || 0,
                stop: !1,
                ms: b,
                easing: R,
                from: w,
                diff: S,
                to: E,
                el: r,
                callback: f.callback,
                prev: v,
                next: d,
                repeat: a || t.times,
                origin: r.attr(),
                totalOrigin: u
            }, Nn.push(x);
            if (s && !l && !c) {
                x.stop = !0, x.start = new Date - b * s;
                if (Nn.length == 1) return kn()
            }
            c && (x.start = new Date - x.ms * s), Nn.length == 1 && Cn(kn)
        } else l.initstatus = s, l.start = new Date - l.ms * s;
        eve("raphael.anim.start." + r.id, r, t)
    }
    function _n(e) {
        for (var t = 0; t < Nn.length; t++) Nn[t].el.paper == e && Nn.splice(t--, 1)
    }
    e.version = "2.1.0", e.eve = eve;
    var t, n = /[, ]+/,
		r = {
		    circle: 1,
		    rect: 1,
		    path: 1,
		    ellipse: 1,
		    text: 1,
		    image: 1
		},
		i = /\{(\d+)\}/g,
		s = "prototype",
		o = "hasOwnProperty",
		u = {
		    doc: document,
		    win: window
		},
		a = {
		    was: Object.prototype[o].call(u.win, "Raphael"),
		    is: u.win.Raphael
		},
		f = function () {
		    this.ca = this.customAttributes = {}
		},
		l, c = "appendChild",
		h = "apply",
		p = "concat",
		d = "createTouch" in u.doc,
		v = "",
		m = " ",
		g = String,
		y = "split",
		b = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[y](m),
		w = {
		    mousedown: "touchstart",
		    mousemove: "touchmove",
		    mouseup: "touchend"
		},
		E = g.prototype.toLowerCase,
		S = Math,
		x = S.max,
		T = S.min,
		N = S.abs,
		C = S.pow,
		k = S.PI,
		L = "number",
		A = "string",
		O = "array",
		M = "toString",
		_ = "fill",
		D = Object.prototype.toString,
		P = {},
		H = "push",
		B = e._ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
		j = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
		F = {
		    NaN: 1,
		    Infinity: 1,
		    "-Infinity": 1
		},
		I = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
		q = S.round,
		R = "setAttribute",
		U = parseFloat,
		z = parseInt,
		W = g.prototype.toUpperCase,
		X = e._availableAttrs = {
		    "arrow-end": "none",
		    "arrow-start": "none",
		    blur: 0,
		    "clip-rect": "0 0 1e9 1e9",
		    cursor: "default",
		    cx: 0,
		    cy: 0,
		    fill: "#fff",
		    "fill-opacity": 1,
		    font: '10px "Arial"',
		    "font-family": '"Arial"',
		    "font-size": "10",
		    "font-style": "normal",
		    "font-weight": 400,
		    gradient: 0,
		    height: 0,
		    href: "http://raphaeljs.com/",
		    "letter-spacing": 0,
		    opacity: 1,
		    path: "M0,0",
		    r: 0,
		    rx: 0,
		    ry: 0,
		    src: "",
		    stroke: "#000",
		    "stroke-dasharray": "",
		    "stroke-linecap": "butt",
		    "stroke-linejoin": "butt",
		    "stroke-miterlimit": 0,
		    "stroke-opacity": 1,
		    "stroke-width": 1,
		    target: "_blank",
		    "text-anchor": "middle",
		    title: "Raphael",
		    transform: "",
		    width: 0,
		    x: 0,
		    y: 0
		},
		V = e._availableAnimAttrs = {
		    blur: L,
		    "clip-rect": "csv",
		    cx: L,
		    cy: L,
		    fill: "colour",
		    "fill-opacity": L,
		    "font-size": L,
		    height: L,
		    opacity: L,
		    path: "path",
		    r: L,
		    rx: L,
		    ry: L,
		    stroke: "colour",
		    "stroke-opacity": L,
		    "stroke-width": L,
		    transform: "transform",
		    width: L,
		    x: L,
		    y: L
		},
		$ = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]/g,
		J = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,
		K = {
		    hs: 1,
		    rg: 1
		},
		Q = /,?([achlmqrstvxz]),?/gi,
		G = /([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,
		Y = /([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,
		Z = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/ig,
		et = e._radial_gradient = /^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,
		tt = {},
		nt = function (e, t) {
		    return e.key - t.key
		},
		rt = function (e, t) {
		    return U(e) - U(t)
		},
		it = function () { },
		st = function (e) {
		    return e
		},
		ot = e._rectPath = function (e, t, n, r, i) {
		    return i ? [
				["M", e + i, t],
				["l", n - i * 2, 0],
				["a", i, i, 0, 0, 1, i, i],
				["l", 0, r - i * 2],
				["a", i, i, 0, 0, 1, -i, i],
				["l", i * 2 - n, 0],
				["a", i, i, 0, 0, 1, -i, -i],
				["l", 0, i * 2 - r],
				["a", i, i, 0, 0, 1, i, -i],
				["z"]
		    ] : [
				["M", e, t],
				["l", n, 0],
				["l", 0, r],
				["l", -n, 0],
				["z"]
		    ]
		},
		ut = function (e, t, n, r) {
		    return r == null && (r = n), [
				["M", e, t],
				["m", 0, -r],
				["a", n, r, 0, 1, 1, 0, 2 * r],
				["a", n, r, 0, 1, 1, 0, -2 * r],
				["z"]
		    ]
		},
		at = e._getPath = {
		    path: function (e) {
		        return e.attr("path")
		    },
		    circle: function (e) {
		        var t = e.attrs;
		        return ut(t.cx, t.cy, t.r)
		    },
		    ellipse: function (e) {
		        var t = e.attrs;
		        return ut(t.cx, t.cy, t.rx, t.ry)
		    },
		    rect: function (e) {
		        var t = e.attrs;
		        return ot(t.x, t.y, t.width, t.height, t.r)
		    },
		    image: function (e) {
		        var t = e.attrs;
		        return ot(t.x, t.y, t.width, t.height)
		    },
		    text: function (e) {
		        var t = e._getBBox();
		        return ot(t.x, t.y, t.width, t.height)
		    },
		    set: function (e) {
		        var t = e._getBBox();
		        return ot(t.x, t.y, t.width, t.height)
		    }
		},
		ft = e.mapPath = function (e, t) {
		    if (!t) return e;
		    var n, r, i, s, o, u, a;
		    e = zt(e);
		    for (i = 0, o = e.length; i < o; i++) {
		        a = e[i];
		        for (s = 1, u = a.length; s < u; s += 2) n = t.x(a[s], a[s + 1]), r = t.y(a[s], a[s + 1]), a[s] = n, a[s + 1] = r
		    }
		    return e
		};
    e._g = u, e.type = u.win.SVGAngle || u.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML";
    if (e.type == "VML") {
        var lt = u.doc.createElement("div"),
			ct;
        lt.innerHTML = '<v:shape adj="1"/>', ct = lt.firstChild, ct.style.behavior = "url(#default#VML)";
        if (!ct || typeof ct.adj != "object") return e.type = v;
        lt = null
    }
    e.svg = !(e.vml = e.type == "VML"), e._Paper = f, e.fn = l = f.prototype = e.prototype, e._id = 0, e._oid = 0, e.is = function (e, t) {
        return t = E.call(t), t == "finite" ? !F[o](+e) : t == "array" ? e instanceof Array : t == "null" && e === null || t == typeof e && e !== null || t == "object" && e === Object(e) || t == "array" && Array.isArray && Array.isArray(e) || D.call(e).slice(8, -1).toLowerCase() == t
    }, e.angle = function (t, n, r, i, s, o) {
        if (s == null) {
            var u = t - r,
				a = n - i;
            return !u && !a ? 0 : (180 + S.atan2(-a, -u) * 180 / k + 360) % 360
        }
        return e.angle(t, n, s, o) - e.angle(r, i, s, o)
    }, e.rad = function (e) {
        return e % 360 * k / 180
    }, e.deg = function (e) {
        return e * 180 / k % 360
    }, e.snapTo = function (t, n, r) {
        r = e.is(r, "finite") ? r : 10;
        if (e.is(t, O)) {
            var i = t.length;
            while (i--) if (N(t[i] - n) <= r) return t[i]
        } else {
            t = +t;
            var s = n % t;
            if (s < r) return n - s;
            if (s > t - r) return n - s + t
        }
        return n
    };
    var pt = e.createUUID = function (e, t) {
        return function () {
            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e, t).toUpperCase()
        }
    }(/[xy]/g, function (e) {
        var t = S.random() * 16 | 0,
            n = e == "x" ? t : t & 3 | 8;
        return n.toString(16)
    });
    e.setWindow = function (t) {
        eve("raphael.setWindow", e, u.win, t), u.win = t, u.doc = u.win.document, e._engine.initWin && e._engine.initWin(u.win)
    };
    var dt = function (t) {
        if (e.vml) {
            var n = /^\s+|\s+$/g,
                r;
            try {
                var i = new ActiveXObject("htmlfile");
                i.write("<body>"), i.close(), r = i.body
            } catch (s) {
                r = createPopup().document.body
            }
            var o = r.createTextRange();
            dt = Et(function (e) {
                try {
                    r.style.color = g(e).replace(n, v);
                    var t = o.queryCommandValue("ForeColor");
                    return t = (t & 255) << 16 | t & 65280 | (t & 16711680) >>> 16, "#" + ("000000" + t.toString(16)).slice(-6)
                } catch (i) {
                    return "none"
                }
            })
        } else {
            var a = u.doc.createElement("i");
            a.title = "Rapha\u00ebl Colour Picker", a.style.display = "none", u.doc.body.appendChild(a), dt = Et(function (e) {
                return a.style.color = e, u.doc.defaultView.getComputedStyle(a, v).getPropertyValue("color")
            })
        }
        return dt(t)
    },
		vt = function () {
		    return "hsb(" + [this.h, this.s, this.b] + ")"
		},
		mt = function () {
		    return "hsl(" + [this.h, this.s, this.l] + ")"
		},
		gt = function () {
		    return this.hex
		},
		yt = function (t, n, r) {
		    n == null && e.is(t, "object") && "r" in t && "g" in t && "b" in t && (r = t.b, n = t.g, t = t.r);
		    if (n == null && e.is(t, A)) {
		        var i = e.getRGB(t);
		        t = i.r, n = i.g, r = i.b
		    }
		    if (t > 1 || n > 1 || r > 1) t /= 255, n /= 255, r /= 255;
		    return [t, n, r]
		},
		bt = function (t, n, r, i) {
		    t *= 255, n *= 255, r *= 255;
		    var s = {
		        r: t,
		        g: n,
		        b: r,
		        hex: e.rgb(t, n, r),
		        toString: gt
		    };
		    return e.is(i, "finite") && (s.opacity = i), s
		};
    e.color = function (t) {
        var n;
        return e.is(t, "object") && "h" in t && "s" in t && "b" in t ? (n = e.hsb2rgb(t), t.r = n.r, t.g = n.g, t.b = n.b, t.hex = n.hex) : e.is(t, "object") && "h" in t && "s" in t && "l" in t ? (n = e.hsl2rgb(t), t.r = n.r, t.g = n.g, t.b = n.b, t.hex = n.hex) : (e.is(t, "string") && (t = e.getRGB(t)), e.is(t, "object") && "r" in t && "g" in t && "b" in t ? (n = e.rgb2hsl(t), t.h = n.h, t.s = n.s, t.l = n.l, n = e.rgb2hsb(t), t.v = n.b) : (t = {
            hex: "none"
        }, t.r = t.g = t.b = t.h = t.s = t.v = t.l = -1)), t.toString = gt, t
    }, e.hsb2rgb = function (e, t, n, r) {
        this.is(e, "object") && "h" in e && "s" in e && "b" in e && (n = e.b, t = e.s, e = e.h, r = e.o), e *= 360;
        var i, s, o, u, a;
        return e = e % 360 / 60, a = n * t, u = a * (1 - N(e % 2 - 1)), i = s = o = n - a, e = ~~e, i += [a, u, 0, 0, u, a][e], s += [u, a, a, u, 0, 0][e], o += [0, 0, u, a, a, u][e], bt(i, s, o, r)
    }, e.hsl2rgb = function (e, t, n, r) {
        this.is(e, "object") && "h" in e && "s" in e && "l" in e && (n = e.l, t = e.s, e = e.h);
        if (e > 1 || t > 1 || n > 1) e /= 360, t /= 100, n /= 100;
        e *= 360;
        var i, s, o, u, a;
        return e = e % 360 / 60, a = 2 * t * (n < .5 ? n : 1 - n), u = a * (1 - N(e % 2 - 1)), i = s = o = n - a / 2, e = ~~e, i += [a, u, 0, 0, u, a][e], s += [u, a, a, u, 0, 0][e], o += [0, 0, u, a, a, u][e], bt(i, s, o, r)
    }, e.rgb2hsb = function (e, t, n) {
        n = yt(e, t, n), e = n[0], t = n[1], n = n[2];
        var r, i, s, o;
        return s = x(e, t, n), o = s - T(e, t, n), r = o == 0 ? null : s == e ? (t - n) / o : s == t ? (n - e) / o + 2 : (e - t) / o + 4, r = (r + 360) % 6 * 60 / 360, i = o == 0 ? 0 : o / s, {
            h: r,
            s: i,
            b: s,
            toString: vt
        }
    }, e.rgb2hsl = function (e, t, n) {
        n = yt(e, t, n), e = n[0], t = n[1], n = n[2];
        var r, i, s, o, u, a;
        return o = x(e, t, n), u = T(e, t, n), a = o - u, r = a == 0 ? null : o == e ? (t - n) / a : o == t ? (n - e) / a + 2 : (e - t) / a + 4, r = (r + 360) % 6 * 60 / 360, s = (o + u) / 2, i = a == 0 ? 0 : s < .5 ? a / (2 * s) : a / (2 - 2 * s), {
            h: r,
            s: i,
            l: s,
            toString: mt
        }
    }, e._path2string = function () {
        return this.join(",").replace(Q, "$1")
    };
    var St = e._preload = function (e, t) {
        var n = u.doc.createElement("img");
        n.style.cssText = "position:absolute;left:-9999em;top:-9999em", n.onload = function () {
            t.call(this), this.onload = null, u.doc.body.removeChild(this)
        }, n.onerror = function () {
            u.doc.body.removeChild(this)
        }, u.doc.body.appendChild(n), n.src = e
    };
    e.getRGB = Et(function (t) {
        if (!t || !!((t = g(t)).indexOf("-") + 1)) return {
            r: -1,
            g: -1,
            b: -1,
            hex: "none",
            error: 1,
            toString: xt
        };
        if (t == "none") return {
            r: -1,
            g: -1,
            b: -1,
            hex: "none",
            toString: xt
        };
        !K[o](t.toLowerCase().substring(0, 2)) && t.charAt() != "#" && (t = dt(t));
        var n, r, i, s, u, a, f, l = t.match(j);
        return l ? (l[2] && (s = z(l[2].substring(5), 16), i = z(l[2].substring(3, 5), 16), r = z(l[2].substring(1, 3), 16)), l[3] && (s = z((a = l[3].charAt(3)) + a, 16), i = z((a = l[3].charAt(2)) + a, 16), r = z((a = l[3].charAt(1)) + a, 16)), l[4] && (f = l[4][y](J), r = U(f[0]), f[0].slice(-1) == "%" && (r *= 2.55), i = U(f[1]), f[1].slice(-1) == "%" && (i *= 2.55), s = U(f[2]), f[2].slice(-1) == "%" && (s *= 2.55), l[1].toLowerCase().slice(0, 4) == "rgba" && (u = U(f[3])), f[3] && f[3].slice(-1) == "%" && (u /= 100)), l[5] ? (f = l[5][y](J), r = U(f[0]), f[0].slice(-1) == "%" && (r *= 2.55), i = U(f[1]), f[1].slice(-1) == "%" && (i *= 2.55), s = U(f[2]), f[2].slice(-1) == "%" && (s *= 2.55), (f[0].slice(-3) == "deg" || f[0].slice(-1) == "\u00b0") && (r /= 360), l[1].toLowerCase().slice(0, 4) == "hsba" && (u = U(f[3])), f[3] && f[3].slice(-1) == "%" && (u /= 100), e.hsb2rgb(r, i, s, u)) : l[6] ? (f = l[6][y](J), r = U(f[0]), f[0].slice(-1) == "%" && (r *= 2.55), i = U(f[1]), f[1].slice(-1) == "%" && (i *= 2.55), s = U(f[2]), f[2].slice(-1) == "%" && (s *= 2.55), (f[0].slice(-3) == "deg" || f[0].slice(-1) == "\u00b0") && (r /= 360), l[1].toLowerCase().slice(0, 4) == "hsla" && (u = U(f[3])), f[3] && f[3].slice(-1) == "%" && (u /= 100), e.hsl2rgb(r, i, s, u)) : (l = {
            r: r,
            g: i,
            b: s,
            toString: xt
        }, l.hex = "#" + (16777216 | s | i << 8 | r << 16).toString(16).slice(1), e.is(u, "finite") && (l.opacity = u), l)) : {
            r: -1,
            g: -1,
            b: -1,
            hex: "none",
            error: 1,
            toString: xt
        }
    }, e), e.hsb = Et(function (t, n, r) {
        return e.hsb2rgb(t, n, r).hex
    }), e.hsl = Et(function (t, n, r) {
        return e.hsl2rgb(t, n, r).hex
    }), e.rgb = Et(function (e, t, n) {
        return "#" + (16777216 | n | t << 8 | e << 16).toString(16).slice(1)
    }), e.getColor = function (e) {
        var t = this.getColor.start = this.getColor.start || {
            h: 0,
            s: 1,
            b: e || .75
        },
			n = this.hsb2rgb(t.h, t.s, t.b);
        return t.h += .075, t.h > 1 && (t.h = 0, t.s -= .2, t.s <= 0 && (this.getColor.start = {
            h: 0,
            s: 1,
            b: t.b
        })), n.hex
    }, e.getColor.reset = function () {
        delete this.start
    }, e.parsePathString = function (t) {
        if (!t) return null;
        var n = Nt(t);
        if (n.arr) return Ht(n.arr);
        var r = {
            a: 7,
            c: 6,
            h: 1,
            l: 2,
            m: 2,
            r: 4,
            q: 4,
            s: 4,
            t: 2,
            v: 1,
            z: 0
        },
			i = [];
        return e.is(t, O) && e.is(t[0], O) && (i = Ht(t)), i.length || g(t).replace(G, function (e, t, n) {
            var s = [],
				o = t.toLowerCase();
            n.replace(Z, function (e, t) {
                t && s.push(+t)
            }), o == "m" && s.length > 2 && (i.push([t][p](s.splice(0, 2))), o = "l", t = t == "m" ? "l" : "L");
            if (o == "r") i.push([t][p](s));
            else while (s.length >= r[o]) {
                i.push([t][p](s.splice(0, r[o])));
                if (!r[o]) break
            }
        }), i.toString = e._path2string, n.arr = Ht(i), i
    }, e.parseTransformString = Et(function (t) {
        if (!t) return null;
        var n = {
            r: 3,
            s: 4,
            t: 2,
            m: 6
        },
			r = [];
        return e.is(t, O) && e.is(t[0], O) && (r = Ht(t)), r.length || g(t).replace(Y, function (e, t, n) {
            var i = [],
				s = E.call(t);
            n.replace(Z, function (e, t) {
                t && i.push(+t)
            }), r.push([t][p](i))
        }), r.toString = e._path2string, r
    });
    var Nt = function (e) {
        var t = Nt.ps = Nt.ps || {};
        return t[e] ? t[e].sleep = 100 : t[e] = {
            sleep: 100
        }, setTimeout(function () {
            for (var n in t) t[o](n) && n != e && (t[n].sleep--, !t[n].sleep && delete t[n])
        }), t[e]
    };
    e.findDotsAtSegment = function (e, t, n, r, i, s, o, u, a) {
        var f = 1 - a,
			l = C(f, 3),
			c = C(f, 2),
			h = a * a,
			p = h * a,
			d = l * e + c * 3 * a * n + f * 3 * a * a * i + p * o,
			v = l * t + c * 3 * a * r + f * 3 * a * a * s + p * u,
			m = e + 2 * a * (n - e) + h * (i - 2 * n + e),
			g = t + 2 * a * (r - t) + h * (s - 2 * r + t),
			y = n + 2 * a * (i - n) + h * (o - 2 * i + n),
			b = r + 2 * a * (s - r) + h * (u - 2 * s + r),
			w = f * e + a * n,
			E = f * t + a * r,
			x = f * i + a * o,
			T = f * s + a * u,
			N = 90 - S.atan2(m - y, g - b) * 180 / k;
        return (m > y || g < b) && (N += 180), {
            x: d,
            y: v,
            m: {
                x: m,
                y: g
            },
            n: {
                x: y,
                y: b
            },
            start: {
                x: w,
                y: E
            },
            end: {
                x: x,
                y: T
            },
            alpha: N
        }
    }, e.bezierBBox = function (t, n, r, i, s, o, u, a) {
        e.is(t, "array") || (t = [t, n, r, i, s, o, u, a]);
        var f = Ut.apply(null, t);
        return {
            x: f.min.x,
            y: f.min.y,
            x2: f.max.x,
            y2: f.max.y,
            width: f.max.x - f.min.x,
            height: f.max.y - f.min.y
        }
    }, e.isPointInsideBBox = function (e, t, n) {
        return t >= e.x && t <= e.x2 && n >= e.y && n <= e.y2
    }, e.isBBoxIntersect = function (t, n) {
        var r = e.isPointInsideBBox;
        return r(n, t.x, t.y) || r(n, t.x2, t.y) || r(n, t.x, t.y2) || r(n, t.x2, t.y2) || r(t, n.x, n.y) || r(t, n.x2, n.y) || r(t, n.x, n.y2) || r(t, n.x2, n.y2) || (t.x < n.x2 && t.x > n.x || n.x < t.x2 && n.x > t.x) && (t.y < n.y2 && t.y > n.y || n.y < t.y2 && n.y > t.y)
    }, e.pathIntersection = function (e, t) {
        return Dt(e, t)
    }, e.pathIntersectionNumber = function (e, t) {
        return Dt(e, t, 1)
    }, e.isPointInsidePath = function (t, n, r) {
        var i = e.pathBBox(t);
        return e.isPointInsideBBox(i, n, r) && Dt(t, [
			["M", n, r],
			["H", i.x2 + 10]
        ], 1) % 2 == 1
    }, e._removedFactory = function (e) {
        return function () {
            eve("raphael.log", null, "Rapha\u00ebl: you are calling to method \u201c" + e + "\u201d of removed object", e)
        }
    };
    var Pt = e.pathBBox = function (e) {
        var t = Nt(e);
        if (t.bbox) return ht(t.bbox);
        if (!e) return {
            x: 0,
            y: 0,
            width: 0,
            height: 0,
            x2: 0,
            y2: 0
        };
        e = zt(e);
        var n = 0,
            r = 0,
            i = [],
            s = [],
            o;
        for (var u = 0, a = e.length; u < a; u++) {
            o = e[u];
            if (o[0] == "M") n = o[1], r = o[2], i.push(n), s.push(r);
            else {
                var f = Ut(n, r, o[1], o[2], o[3], o[4], o[5], o[6]);
                i = i[p](f.min.x, f.max.x), s = s[p](f.min.y, f.max.y), n = o[5], r = o[6]
            }
        }
        var l = T[h](0, i),
            c = T[h](0, s),
            d = x[h](0, i),
            v = x[h](0, s),
            m = d - l,
            g = v - c,
            y = {
                x: l,
                y: c,
                x2: d,
                y2: v,
                width: m,
                height: g,
                cx: l + m / 2,
                cy: c + g / 2
            };
        return t.bbox = ht(y), y
    },
		Ht = function (t) {
		    var n = ht(t);
		    return n.toString = e._path2string, n
		},
		Bt = e._pathToRelative = function (t) {
		    var n = Nt(t);
		    if (n.rel) return Ht(n.rel);
		    if (!e.is(t, O) || !e.is(t && t[0], O)) t = e.parsePathString(t);
		    var r = [],
				i = 0,
				s = 0,
				o = 0,
				u = 0,
				a = 0;
		    t[0][0] == "M" && (i = t[0][1], s = t[0][2], o = i, u = s, a++, r.push(["M", i, s]));
		    for (var f = a, l = t.length; f < l; f++) {
		        var c = r[f] = [],
					h = t[f];
		        if (h[0] != E.call(h[0])) {
		            c[0] = E.call(h[0]);
		            switch (c[0]) {
		                case "a":
		                    c[1] = h[1], c[2] = h[2], c[3] = h[3], c[4] = h[4], c[5] = h[5], c[6] = +(h[6] - i).toFixed(3), c[7] = +(h[7] - s).toFixed(3);
		                    break;
		                case "v":
		                    c[1] = +(h[1] - s).toFixed(3);
		                    break;
		                case "m":
		                    o = h[1], u = h[2];
		                default:
		                    for (var p = 1, d = h.length; p < d; p++) c[p] = +(h[p] - (p % 2 ? i : s)).toFixed(3)
		            }
		        } else {
		            c = r[f] = [], h[0] == "m" && (o = h[1] + i, u = h[2] + s);
		            for (var v = 0, m = h.length; v < m; v++) r[f][v] = h[v]
		        }
		        var g = r[f].length;
		        switch (r[f][0]) {
		            case "z":
		                i = o, s = u;
		                break;
		            case "h":
		                i += +r[f][g - 1];
		                break;
		            case "v":
		                s += +r[f][g - 1];
		                break;
		            default:
		                i += +r[f][g - 2], s += +r[f][g - 1]
		        }
		    }
		    return r.toString = e._path2string, n.rel = Ht(r), r
		},
		jt = e._pathToAbsolute = function (t) {
		    var n = Nt(t);
		    if (n.abs) return Ht(n.abs);
		    if (!e.is(t, O) || !e.is(t && t[0], O)) t = e.parsePathString(t);
		    if (!t || !t.length) return [["M", 0, 0]];
		    var r = [],
				i = 0,
				s = 0,
				o = 0,
				u = 0,
				a = 0;
		    t[0][0] == "M" && (i = +t[0][1], s = +t[0][2], o = i, u = s, a++, r[0] = ["M", i, s]);
		    var f = t.length == 3 && t[0][0] == "M" && t[1][0].toUpperCase() == "R" && t[2][0].toUpperCase() == "Z";
		    for (var l, c, h = a, d = t.length; h < d; h++) {
		        r.push(l = []), c = t[h];
		        if (c[0] != W.call(c[0])) {
		            l[0] = W.call(c[0]);
		            switch (l[0]) {
		                case "A":
		                    l[1] = c[1], l[2] = c[2], l[3] = c[3], l[4] = c[4], l[5] = c[5], l[6] = +(c[6] + i), l[7] = +(c[7] + s);
		                    break;
		                case "V":
		                    l[1] = +c[1] + s;
		                    break;
		                case "H":
		                    l[1] = +c[1] + i;
		                    break;
		                case "R":
		                    var v = [i, s][p](c.slice(1));
		                    for (var m = 2, g = v.length; m < g; m++) v[m] = +v[m] + i, v[++m] = +v[m] + s;
		                    r.pop(), r = r[p](Tt(v, f));
		                    break;
		                case "M":
		                    o = +c[1] + i, u = +c[2] + s;
		                default:
		                    for (m = 1, g = c.length; m < g; m++) l[m] = +c[m] + (m % 2 ? i : s)
		            }
		        } else if (c[0] == "R") v = [i, s][p](c.slice(1)), r.pop(), r = r[p](Tt(v, f)), l = ["R"][p](c.slice(-2));
		        else for (var y = 0, b = c.length; y < b; y++) l[y] = c[y];
		        switch (l[0]) {
		            case "Z":
		                i = o, s = u;
		                break;
		            case "H":
		                i = l[1];
		                break;
		            case "V":
		                s = l[1];
		                break;
		            case "M":
		                o = l[l.length - 2], u = l[l.length - 1];
		            default:
		                i = l[l.length - 2], s = l[l.length - 1]
		        }
		    }
		    return r.toString = e._path2string, n.abs = Ht(r), r
		},
		Ft = function (e, t, n, r) {
		    return [e, t, n, r, n, r]
		},
		It = function (e, t, n, r, i, s) {
		    var o = 1 / 3,
				u = 2 / 3;
		    return [o * e + u * n, o * t + u * r, o * i + u * n, o * s + u * r, i, s]
		},
		qt = function (e, t, n, r, i, s, o, u, a, f) {
		    var l = k * 120 / 180,
				c = k / 180 * (+i || 0),
				h = [],
				d, v = Et(function (e, t, n) {
				    var r = e * S.cos(n) - t * S.sin(n),
						i = e * S.sin(n) + t * S.cos(n);
				    return {
				        x: r,
				        y: i
				    }
				});
		    if (!f) {
		        d = v(e, t, -c), e = d.x, t = d.y, d = v(u, a, -c), u = d.x, a = d.y;
		        var m = S.cos(k / 180 * i),
					g = S.sin(k / 180 * i),
					b = (e - u) / 2,
					w = (t - a) / 2,
					E = b * b / (n * n) + w * w / (r * r);
		        E > 1 && (E = S.sqrt(E), n = E * n, r = E * r);
		        var x = n * n,
					T = r * r,
					C = (s == o ? -1 : 1) * S.sqrt(N((x * T - x * w * w - T * b * b) / (x * w * w + T * b * b))),
					L = C * n * w / r + (e + u) / 2,
					A = C * -r * b / n + (t + a) / 2,
					O = S.asin(((t - A) / r).toFixed(9)),
					M = S.asin(((a - A) / r).toFixed(9));
		        O = e < L ? k - O : O, M = u < L ? k - M : M, O < 0 && (O = k * 2 + O), M < 0 && (M = k * 2 + M), o && O > M && (O -= k * 2), !o && M > O && (M -= k * 2)
		    } else O = f[0], M = f[1], L = f[2], A = f[3];
		    var _ = M - O;
		    if (N(_) > l) {
		        var D = M,
					P = u,
					H = a;
		        M = O + l * (o && M > O ? 1 : -1), u = L + n * S.cos(M), a = A + r * S.sin(M), h = qt(u, a, n, r, i, 0, o, P, H, [M, D, L, A])
		    }
		    _ = M - O;
		    var B = S.cos(O),
				j = S.sin(O),
				F = S.cos(M),
				I = S.sin(M),
				q = S.tan(_ / 4),
				R = 4 / 3 * n * q,
				U = 4 / 3 * r * q,
				z = [e, t],
				W = [e + R * j, t - U * B],
				X = [u + R * I, a - U * F],
				V = [u, a];
		    W[0] = 2 * z[0] - W[0], W[1] = 2 * z[1] - W[1];
		    if (f) return [W, X, V][p](h);
		    h = [W, X, V][p](h).join()[y](",");
		    var $ = [];
		    for (var J = 0, K = h.length; J < K; J++) $[J] = J % 2 ? v(h[J - 1], h[J], c).y : v(h[J], h[J + 1], c).x;
		    return $
		},
		Rt = function (e, t, n, r, i, s, o, u, a) {
		    var f = 1 - a;
		    return {
		        x: C(f, 3) * e + C(f, 2) * 3 * a * n + f * 3 * a * a * i + C(a, 3) * o,
		        y: C(f, 3) * t + C(f, 2) * 3 * a * r + f * 3 * a * a * s + C(a, 3) * u
		    }
		},
		Ut = Et(function (e, t, n, r, i, s, o, u) {
		    var a = i - 2 * n + e - (o - 2 * i + n),
				f = 2 * (n - e) - 2 * (i - n),
				l = e - n,
				c = (-f + S.sqrt(f * f - 4 * a * l)) / 2 / a,
				p = (-f - S.sqrt(f * f - 4 * a * l)) / 2 / a,
				d = [t, u],
				v = [e, o],
				m;
		    return N(c) > "1e12" && (c = .5), N(p) > "1e12" && (p = .5), c > 0 && c < 1 && (m = Rt(e, t, n, r, i, s, o, u, c), v.push(m.x), d.push(m.y)), p > 0 && p < 1 && (m = Rt(e, t, n, r, i, s, o, u, p), v.push(m.x), d.push(m.y)), a = s - 2 * r + t - (u - 2 * s + r), f = 2 * (r - t) - 2 * (s - r), l = t - r, c = (-f + S.sqrt(f * f - 4 * a * l)) / 2 / a, p = (-f - S.sqrt(f * f - 4 * a * l)) / 2 / a, N(c) > "1e12" && (c = .5), N(p) > "1e12" && (p = .5), c > 0 && c < 1 && (m = Rt(e, t, n, r, i, s, o, u, c), v.push(m.x), d.push(m.y)), p > 0 && p < 1 && (m = Rt(e, t, n, r, i, s, o, u, p), v.push(m.x), d.push(m.y)), {
		        min: {
		            x: T[h](0, v),
		            y: T[h](0, d)
		        },
		        max: {
		            x: x[h](0, v),
		            y: x[h](0, d)
		        }
		    }
		}),
		zt = e._path2curve = Et(function (e, t) {
		    var n = !t && Nt(e);
		    if (!t && n.curve) return Ht(n.curve);
		    var r = jt(e),
				i = t && jt(t),
				s = {
				    x: 0,
				    y: 0,
				    bx: 0,
				    by: 0,
				    X: 0,
				    Y: 0,
				    qx: null,
				    qy: null
				},
				o = {
				    x: 0,
				    y: 0,
				    bx: 0,
				    by: 0,
				    X: 0,
				    Y: 0,
				    qx: null,
				    qy: null
				},
				u = function (e, t) {
				    var n, r;
				    if (!e) return ["C", t.x, t.y, t.x, t.y, t.x, t.y];
				    !(e[0] in {
				        T: 1,
				        Q: 1
				    }) && (t.qx = t.qy = null);
				    switch (e[0]) {
				        case "M":
				            t.X = e[1], t.Y = e[2];
				            break;
				        case "A":
				            e = ["C"][p](qt[h](0, [t.x, t.y][p](e.slice(1))));
				            break;
				        case "S":
				            n = t.x + (t.x - (t.bx || t.x)), r = t.y + (t.y - (t.by || t.y)), e = ["C", n, r][p](e.slice(1));
				            break;
				        case "T":
				            t.qx = t.x + (t.x - (t.qx || t.x)), t.qy = t.y + (t.y - (t.qy || t.y)), e = ["C"][p](It(t.x, t.y, t.qx, t.qy, e[1], e[2]));
				            break;
				        case "Q":
				            t.qx = e[1], t.qy = e[2], e = ["C"][p](It(t.x, t.y, e[1], e[2], e[3], e[4]));
				            break;
				        case "L":
				            e = ["C"][p](Ft(t.x, t.y, e[1], e[2]));
				            break;
				        case "H":
				            e = ["C"][p](Ft(t.x, t.y, e[1], t.y));
				            break;
				        case "V":
				            e = ["C"][p](Ft(t.x, t.y, t.x, e[1]));
				            break;
				        case "Z":
				            e = ["C"][p](Ft(t.x, t.y, t.X, t.Y))
				    }
				    return e
				},
				a = function (e, t) {
				    if (e[t].length > 7) {
				        e[t].shift();
				        var n = e[t];
				        while (n.length) e.splice(t++, 0, ["C"][p](n.splice(0, 6)));
				        e.splice(t, 1), c = x(r.length, i && i.length || 0)
				    }
				},
				f = function (e, t, n, s, o) {
				    e && t && e[o][0] == "M" && t[o][0] != "M" && (t.splice(o, 0, ["M", s.x, s.y]), n.bx = 0, n.by = 0, n.x = e[o][1], n.y = e[o][2], c = x(r.length, i && i.length || 0))
				};
		    for (var l = 0, c = x(r.length, i && i.length || 0) ; l < c; l++) {
		        r[l] = u(r[l], s), a(r, l), i && (i[l] = u(i[l], o)), i && a(i, l), f(r, i, s, o, l), f(i, r, o, s, l);
		        var d = r[l],
					v = i && i[l],
					m = d.length,
					g = i && v.length;
		        s.x = d[m - 2], s.y = d[m - 1], s.bx = U(d[m - 4]) || s.x, s.by = U(d[m - 3]) || s.y, o.bx = i && (U(v[g - 4]) || o.x), o.by = i && (U(v[g - 3]) || o.y), o.x = i && v[g - 2], o.y = i && v[g - 1]
		    }
		    return i || (n.curve = Ht(r)), i ? [r, i] : r
		}, null, Ht),
		Wt = e._parseDots = Et(function (t) {
		    var n = [];
		    for (var r = 0, i = t.length; r < i; r++) {
		        var s = {},
					o = t[r].match(/^([^:]*):?([\d\.]*)/);
		        s.color = e.getRGB(o[1]);
		        if (s.color.error) return null;
		        s.color = s.color.hex, o[2] && (s.offset = o[2] + "%"), n.push(s)
		    }
		    for (r = 1, i = n.length - 1; r < i; r++) if (!n[r].offset) {
		        var u = U(n[r - 1].offset || 0),
					a = 0;
		        for (var f = r + 1; f < i; f++) if (n[f].offset) {
		            a = n[f].offset;
		            break
		        }
		        a || (a = 100, f = i), a = U(a);
		        var l = (a - u) / (f - r + 1);
		        for (; r < f; r++) u += l, n[r].offset = u + "%"
		    }
		    return n
		}),
		Xt = e._tear = function (e, t) {
		    e == t.top && (t.top = e.prev), e == t.bottom && (t.bottom = e.next), e.next && (e.next.prev = e.prev), e.prev && (e.prev.next = e.next)
		},
		Vt = e._tofront = function (e, t) {
		    if (t.top === e) return;
		    Xt(e, t), e.next = null, e.prev = t.top, t.top.next = e, t.top = e
		},
		$t = e._toback = function (e, t) {
		    if (t.bottom === e) return;
		    Xt(e, t), e.next = t.bottom, e.prev = null, t.bottom.prev = e, t.bottom = e
		},
		Jt = e._insertafter = function (e, t, n) {
		    Xt(e, n), t == n.top && (n.top = e), t.next && (t.next.prev = e), e.next = t.next, e.prev = t, t.next = e
		},
		Kt = e._insertbefore = function (e, t, n) {
		    Xt(e, n), t == n.bottom && (n.bottom = e), t.prev && (t.prev.next = e), e.prev = t.prev, t.prev = e, e.next = t
		},
		Qt = e.toMatrix = function (e, t) {
		    var n = Pt(e),
				r = {
				    _: {
				        transform: v
				    },
				    getBBox: function () {
				        return n
				    }
				};
		    return Yt(r, t), r.matrix
		},
		Gt = e.transformPath = function (e, t) {
		    return ft(e, Qt(e, t))
		},
		Yt = e._extractTransform = function (t, n) {
		    if (n == null) return t._.transform;
		    n = g(n).replace(/\.{3}|\u2026/g, t._.transform || v);
		    var r = e.parseTransformString(n),
				i = 0,
				s = 0,
				o = 0,
				u = 1,
				a = 1,
				f = t._,
				l = new tn;
		    f.transform = r || [];
		    if (r) for (var c = 0, h = r.length; c < h; c++) {
		        var p = r[c],
					d = p.length,
					m = g(p[0]).toLowerCase(),
					y = p[0] != m,
					b = y ? l.invert() : 0,
					w, E, S, x, T;
		        m == "t" && d == 3 ? y ? (w = b.x(0, 0), E = b.y(0, 0), S = b.x(p[1], p[2]), x = b.y(p[1], p[2]), l.translate(S - w, x - E)) : l.translate(p[1], p[2]) : m == "r" ? d == 2 ? (T = T || t.getBBox(1), l.rotate(p[1], T.x + T.width / 2, T.y + T.height / 2), i += p[1]) : d == 4 && (y ? (S = b.x(p[2], p[3]), x = b.y(p[2], p[3]), l.rotate(p[1], S, x)) : l.rotate(p[1], p[2], p[3]), i += p[1]) : m == "s" ? d == 2 || d == 3 ? (T = T || t.getBBox(1), l.scale(p[1], p[d - 1], T.x + T.width / 2, T.y + T.height / 2), u *= p[1], a *= p[d - 1]) : d == 5 && (y ? (S = b.x(p[3], p[4]), x = b.y(p[3], p[4]), l.scale(p[1], p[2], S, x)) : l.scale(p[1], p[2], p[3], p[4]), u *= p[1], a *= p[2]) : m == "m" && d == 7 && l.add(p[1], p[2], p[3], p[4], p[5], p[6]), f.dirtyT = 1, t.matrix = l
		    }
		    t.matrix = l, f.sx = u, f.sy = a, f.deg = i, f.dx = s = l.e, f.dy = o = l.f, u == 1 && a == 1 && !i && f.bbox ? (f.bbox.x += +s, f.bbox.y += +o) : f.dirtyT = 1
		},
		Zt = function (e) {
		    var t = e[0];
		    switch (t.toLowerCase()) {
		        case "t":
		            return [t, 0, 0];
		        case "m":
		            return [t, 1, 0, 0, 1, 0, 0];
		        case "r":
		            return e.length == 4 ? [t, 0, e[2], e[3]] : [t, 0];
		        case "s":
		            return e.length == 5 ? [t, 1, 1, e[3], e[4]] : e.length == 3 ? [t, 1, 1] : [t, 1]
		    }
		},
		en = e._equaliseTransform = function (t, n) {
		    n = g(n).replace(/\.{3}|\u2026/g, t), t = e.parseTransformString(t) || [], n = e.parseTransformString(n) || [];
		    var r = x(t.length, n.length),
				i = [],
				s = [],
				o = 0,
				u, a, f, l;
		    for (; o < r; o++) {
		        f = t[o] || Zt(n[o]), l = n[o] || Zt(f);
		        if (f[0] != l[0] || f[0].toLowerCase() == "r" && (f[2] != l[2] || f[3] != l[3]) || f[0].toLowerCase() == "s" && (f[3] != l[3] || f[4] != l[4])) return;
		        i[o] = [], s[o] = [];
		        for (u = 0, a = x(f.length, l.length) ; u < a; u++) u in f && (i[o][u] = f[u]), u in l && (s[o][u] = l[u])
		    }
		    return {
		        from: i,
		        to: s
		    }
		};
    e._getContainer = function (t, n, r, i) {
        var s;
        s = i == null && !e.is(t, "object") ? u.doc.getElementById(t) : t;
        if (s == null) return;
        return s.tagName ? n == null ? {
            container: s,
            width: s.style.pixelWidth || s.offsetWidth,
            height: s.style.pixelHeight || s.offsetHeight
        } : {
            container: s,
            width: n,
            height: r
        } : {
            container: 1,
            x: t,
            y: n,
            width: r,
            height: i
        }
    }, e.pathToRelative = Bt, e._engine = {}, e.path2curve = zt, e.matrix = function (e, t, n, r, i, s) {
        return new tn(e, t, n, r, i, s)
    }, function (t) {
        function n(e) {
            return e[0] * e[0] + e[1] * e[1]
        }
        function r(e) {
            var t = S.sqrt(n(e));
            e[0] && (e[0] /= t), e[1] && (e[1] /= t)
        }
        t.add = function (e, t, n, r, i, s) {
            var o = [
				[],
				[],
				[]
            ],
				u = [
					[this.a, this.c, this.e],
					[this.b, this.d, this.f],
					[0, 0, 1]
				],
				a = [
					[e, n, i],
					[t, r, s],
					[0, 0, 1]
				],
				f, l, c, h;
            e && e instanceof tn && (a = [
				[e.a, e.c, e.e],
				[e.b, e.d, e.f],
				[0, 0, 1]
            ]);
            for (f = 0; f < 3; f++) for (l = 0; l < 3; l++) {
                h = 0;
                for (c = 0; c < 3; c++) h += u[f][c] * a[c][l];
                o[f][l] = h
            }
            this.a = o[0][0], this.b = o[1][0], this.c = o[0][1], this.d = o[1][1], this.e = o[0][2], this.f = o[1][2]
        }, t.invert = function () {
            var e = this,
				t = e.a * e.d - e.b * e.c;
            return new tn(e.d / t, -e.b / t, -e.c / t, e.a / t, (e.c * e.f - e.d * e.e) / t, (e.b * e.e - e.a * e.f) / t)
        }, t.clone = function () {
            return new tn(this.a, this.b, this.c, this.d, this.e, this.f)
        }, t.translate = function (e, t) {
            this.add(1, 0, 0, 1, e, t)
        }, t.scale = function (e, t, n, r) {
            t == null && (t = e), (n || r) && this.add(1, 0, 0, 1, n, r), this.add(e, 0, 0, t, 0, 0), (n || r) && this.add(1, 0, 0, 1, -n, -r)
        }, t.rotate = function (t, n, r) {
            t = e.rad(t), n = n || 0, r = r || 0;
            var i = +S.cos(t).toFixed(9),
				s = +S.sin(t).toFixed(9);
            this.add(i, s, -s, i, n, r), this.add(1, 0, 0, 1, -n, -r)
        }, t.x = function (e, t) {
            return e * this.a + t * this.c + this.e
        }, t.y = function (e, t) {
            return e * this.b + t * this.d + this.f
        }, t.get = function (e) {
            return +this[g.fromCharCode(97 + e)].toFixed(4)
        }, t.toString = function () {
            return e.svg ? "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")" : [this.get(0), this.get(2), this.get(1), this.get(3), 0, 0].join()
        }, t.toFilter = function () {
            return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.get(0) + ", M12=" + this.get(2) + ", M21=" + this.get(1) + ", M22=" + this.get(3) + ", Dx=" + this.get(4) + ", Dy=" + this.get(5) + ", sizingmethod='auto expand')"
        }, t.offset = function () {
            return [this.e.toFixed(4), this.f.toFixed(4)]
        }, t.split = function () {
            var t = {};
            t.dx = this.e, t.dy = this.f;
            var i = [
				[this.a, this.c],
				[this.b, this.d]
            ];
            t.scalex = S.sqrt(n(i[0])), r(i[0]), t.shear = i[0][0] * i[1][0] + i[0][1] * i[1][1], i[1] = [i[1][0] - i[0][0] * t.shear, i[1][1] - i[0][1] * t.shear], t.scaley = S.sqrt(n(i[1])), r(i[1]), t.shear /= t.scaley;
            var s = -i[0][1],
				o = i[1][1];
            return o < 0 ? (t.rotate = e.deg(S.acos(o)), s < 0 && (t.rotate = 360 - t.rotate)) : t.rotate = e.deg(S.asin(s)), t.isSimple = !+t.shear.toFixed(9) && (t.scalex.toFixed(9) == t.scaley.toFixed(9) || !t.rotate), t.isSuperSimple = !+t.shear.toFixed(9) && t.scalex.toFixed(9) == t.scaley.toFixed(9) && !t.rotate, t.noRotation = !+t.shear.toFixed(9) && !t.rotate, t
        }, t.toTransformString = function (e) {
            var t = e || this[y]();
            return t.isSimple ? (t.scalex = +t.scalex.toFixed(4), t.scaley = +t.scaley.toFixed(4), t.rotate = +t.rotate.toFixed(4), (t.dx || t.dy ? "t" + [t.dx, t.dy] : v) + (t.scalex != 1 || t.scaley != 1 ? "s" + [t.scalex, t.scaley, 0, 0] : v) + (t.rotate ? "r" + [t.rotate, 0, 0] : v)) : "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)]
        }
    }(tn.prototype);
    var nn = navigator.userAgent.match(/Version\/(.*?)\s/) || navigator.userAgent.match(/Chrome\/(\d+)/);
    navigator.vendor == "Apple Computer, Inc." && (nn && nn[1] < 4 || navigator.platform.slice(0, 2) == "iP") || navigator.vendor == "Google Inc." && nn && nn[1] < 8 ? l.safari = function () {
        var e = this.rect(-99, -99, this.width + 99, this.height + 99).attr({
            stroke: "none"
        });
        setTimeout(function () {
            e.remove()
        })
    } : l.safari = it;
    var rn = function () {
        this.returnValue = !1
    },
		sn = function () {
		    return this.originalEvent.preventDefault()
		},
		on = function () {
		    this.cancelBubble = !0
		},
		un = function () {
		    return this.originalEvent.stopPropagation()
		},
		an = function () {
		    if (u.doc.addEventListener) return function (e, t, n, r) {
		        var i = d && w[t] ? w[t] : t,
					s = function (i) {
					    var s = u.doc.documentElement.scrollTop || u.doc.body.scrollTop,
							a = u.doc.documentElement.scrollLeft || u.doc.body.scrollLeft,
							f = i.clientX + a,
							l = i.clientY + s;
					    if (d && w[o](t)) for (var c = 0, h = i.targetTouches && i.targetTouches.length; c < h; c++) if (i.targetTouches[c].target == e) {
					        var p = i;
					        i = i.targetTouches[c], i.originalEvent = p, i.preventDefault = sn, i.stopPropagation = un;
					        break
					    }
					    return n.call(r, i, f, l)
					};
		        return e.addEventListener(i, s, !1), function () {
		            return e.removeEventListener(i, s, !1), !0
		        }
		    };
		    if (u.doc.attachEvent) return function (e, t, n, r) {
		        var i = function (e) {
		            e = e || u.win.event;
		            var t = u.doc.documentElement.scrollTop || u.doc.body.scrollTop,
                        i = u.doc.documentElement.scrollLeft || u.doc.body.scrollLeft,
                        s = e.clientX + i,
                        o = e.clientY + t;
		            return e.preventDefault = e.preventDefault || rn, e.stopPropagation = e.stopPropagation || on, n.call(r, e, s, o)
		        };
		        e.attachEvent("on" + t, i);
		        var s = function () {
		            return e.detachEvent("on" + t, i), !0
		        };
		        return s
		    }
		}(),
		fn = [],
		ln = function (e) {
		    var t = e.clientX,
				n = e.clientY,
				r = u.doc.documentElement.scrollTop || u.doc.body.scrollTop,
				i = u.doc.documentElement.scrollLeft || u.doc.body.scrollLeft,
				s, o = fn.length;
		    while (o--) {
		        s = fn[o];
		        if (d) {
		            var a = e.touches.length,
						f;
		            while (a--) {
		                f = e.touches[a];
		                if (f.identifier == s.el._drag.id) {
		                    t = f.clientX, n = f.clientY, (e.originalEvent ? e.originalEvent : e).preventDefault();
		                    break
		                }
		            }
		        } else e.preventDefault();
		        var l = s.el.node,
					c, h = l.nextSibling,
					p = l.parentNode,
					v = l.style.display;
		        u.win.opera && p.removeChild(l), l.style.display = "none", c = s.el.paper.getElementByPoint(t, n), l.style.display = v, u.win.opera && (h ? p.insertBefore(l, h) : p.appendChild(l)), c && eve("raphael.drag.over." + s.el.id, s.el, c), t += i, n += r, eve("raphael.drag.move." + s.el.id, s.move_scope || s.el, t - s.el._drag.x, n - s.el._drag.y, t, n, e)
		    }
		},
		cn = function (t) {
		    e.unmousemove(ln).unmouseup(cn);
		    var n = fn.length,
				r;
		    while (n--) r = fn[n], r.el._drag = {}, eve("raphael.drag.end." + r.el.id, r.end_scope || r.start_scope || r.move_scope || r.el, t);
		    fn = []
		},
		hn = e.el = {};
    for (var pn = b.length; pn--;) (function (t) {
        e[t] = hn[t] = function (n, r) {
            return e.is(n, "function") && (this.events = this.events || [], this.events.push({
                name: t,
                f: n,
                unbind: an(this.shape || this.node || u.doc, t, n, r || this)
            })), this
        }, e["un" + t] = hn["un" + t] = function (e) {
            var n = this.events || [],
				r = n.length;
            while (r--) if (n[r].name == t && n[r].f == e) return n[r].unbind(), n.splice(r, 1), !n.length && delete this.events, this;
            return this
        }
    })(b[pn]);
    hn.data = function (t, n) {
        var r = tt[this.id] = tt[this.id] || {};
        if (arguments.length == 1) {
            if (e.is(t, "object")) {
                for (var i in t) t[o](i) && this.data(i, t[i]);
                return this
            }
            return eve("raphael.data.get." + this.id, this, r[t], t), r[t]
        }
        return r[t] = n, eve("raphael.data.set." + this.id, this, n, t), this
    }, hn.removeData = function (e) {
        return e == null ? tt[this.id] = {} : tt[this.id] && delete tt[this.id][e], this
    }, hn.getData = function () {
        return ht(tt[this.id] || {})
    }, hn.hover = function (e, t, n, r) {
        return this.mouseover(e, n).mouseout(t, r || n)
    }, hn.unhover = function (e, t) {
        return this.unmouseover(e).unmouseout(t)
    };
    var dn = [];
    hn.drag = function (t, n, r, i, s, o) {
        function a(a) {
            (a.originalEvent || a).preventDefault();
            var f = u.doc.documentElement.scrollTop || u.doc.body.scrollTop,
				l = u.doc.documentElement.scrollLeft || u.doc.body.scrollLeft;
            this._drag.x = a.clientX + l, this._drag.y = a.clientY + f, this._drag.id = a.identifier, !fn.length && e.mousemove(ln).mouseup(cn), fn.push({
                el: this,
                move_scope: i,
                start_scope: s,
                end_scope: o
            }), n && eve.on("raphael.drag.start." + this.id, n), t && eve.on("raphael.drag.move." + this.id, t), r && eve.on("raphael.drag.end." + this.id, r), eve("raphael.drag.start." + this.id, s || i || this, a.clientX + l, a.clientY + f, a)
        }
        return this._drag = {}, dn.push({
            el: this,
            start: a
        }), this.mousedown(a), this
    }, hn.onDragOver = function (e) {
        e ? eve.on("raphael.drag.over." + this.id, e) : eve.unbind("raphael.drag.over." + this.id)
    }, hn.undrag = function () {
        var t = dn.length;
        while (t--) dn[t].el == this && (this.unmousedown(dn[t].start), dn.splice(t, 1), eve.unbind("raphael.drag.*." + this.id));
        !dn.length && e.unmousemove(ln).unmouseup(cn), fn = []
    }, l.circle = function (t, n, r) {
        var i = e._engine.circle(this, t || 0, n || 0, r || 0);
        return this.__set__ && this.__set__.push(i), i
    }, l.rect = function (t, n, r, i, s) {
        var o = e._engine.rect(this, t || 0, n || 0, r || 0, i || 0, s || 0);
        return this.__set__ && this.__set__.push(o), o
    }, l.ellipse = function (t, n, r, i) {
        var s = e._engine.ellipse(this, t || 0, n || 0, r || 0, i || 0);
        return this.__set__ && this.__set__.push(s), s
    }, l.path = function (t) {
        t && !e.is(t, A) && !e.is(t[0], O) && (t += v);
        var n = e._engine.path(e.format[h](e, arguments), this);
        return this.__set__ && this.__set__.push(n), n
    }, l.image = function (t, n, r, i, s) {
        var o = e._engine.image(this, t || "about:blank", n || 0, r || 0, i || 0, s || 0);
        return this.__set__ && this.__set__.push(o), o
    }, l.text = function (t, n, r) {
        var i = e._engine.text(this, t || 0, n || 0, g(r));
        return this.__set__ && this.__set__.push(i), i
    }, l.set = function (t) {
        !e.is(t, "array") && (t = Array.prototype.splice.call(arguments, 0, arguments.length));
        var n = new Dn(t);
        return this.__set__ && this.__set__.push(n), n.paper = this, n.type = "set", n
    }, l.setStart = function (e) {
        this.__set__ = e || this.set()
    }, l.setFinish = function (e) {
        var t = this.__set__;
        return delete this.__set__, t
    }, l.setSize = function (t, n) {
        return e._engine.setSize.call(this, t, n)
    }, l.setViewBox = function (t, n, r, i, s) {
        return e._engine.setViewBox.call(this, t, n, r, i, s)
    }, l.top = l.bottom = null, l.raphael = e;
    var vn = function (e) {
        var t = e.getBoundingClientRect(),
            n = e.ownerDocument,
            r = n.body,
            i = n.documentElement,
            s = i.clientTop || r.clientTop || 0,
            o = i.clientLeft || r.clientLeft || 0,
            a = t.top + (u.win.pageYOffset || i.scrollTop || r.scrollTop) - s,
            f = t.left + (u.win.pageXOffset || i.scrollLeft || r.scrollLeft) - o;
        return {
            y: a,
            x: f
        }
    };
    l.getElementByPoint = function (e, t) {
        var n = this,
			r = n.canvas,
			i = u.doc.elementFromPoint(e, t);
        if (u.win.opera && i.tagName == "svg") {
            var s = vn(r),
				o = r.createSVGRect();
            o.x = e - s.x, o.y = t - s.y, o.width = o.height = 1;
            var a = r.getIntersectionList(o, null);
            a.length && (i = a[a.length - 1])
        }
        if (!i) return null;
        while (i.parentNode && i != r.parentNode && !i.raphael) i = i.parentNode;
        return i == n.canvas.parentNode && (i = r), i = i && i.raphael ? n.getById(i.raphaelid) : null, i
    }, l.getElementsByBBox = function (t) {
        var n = this.set();
        return this.forEach(function (r) {
            e.isBBoxIntersect(r.getBBox(), t) && n.push(r)
        }), n
    }, l.getById = function (e) {
        var t = this.bottom;
        while (t) {
            if (t.id == e) return t;
            t = t.next
        }
        return null
    }, l.forEach = function (e, t) {
        var n = this.bottom;
        while (n) {
            if (e.call(t, n) === !1) return this;
            n = n.next
        }
        return this
    }, l.getElementsByPoint = function (e, t) {
        var n = this.set();
        return this.forEach(function (r) {
            r.isPointInside(e, t) && n.push(r)
        }), n
    }, hn.isPointInside = function (t, n) {
        var r = this.realPath = this.realPath || at[this.type](this);
        return e.isPointInsidePath(r, t, n)
    }, hn.getBBox = function (e) {
        if (this.removed) return {};
        var t = this._;
        if (e) {
            if (t.dirty || !t.bboxwt) this.realPath = at[this.type](this), t.bboxwt = Pt(this.realPath), t.bboxwt.toString = gn, t.dirty = 0;
            return t.bboxwt
        }
        if (t.dirty || t.dirtyT || !t.bbox) {
            if (t.dirty || !this.realPath) t.bboxwt = 0, this.realPath = at[this.type](this);
            t.bbox = Pt(ft(this.realPath, this.matrix)), t.bbox.toString = gn, t.dirty = t.dirtyT = 0
        }
        return t.bbox
    }, hn.clone = function () {
        if (this.removed) return null;
        var e = this.paper[this.type]().attr(this.attr());
        return this.__set__ && this.__set__.push(e), e
    }, hn.glow = function (e) {
        if (this.type == "text") return null;
        e = e || {};
        var t = {
            width: (e.width || 10) + (+this.attr("stroke-width") || 1),
            fill: e.fill || !1,
            opacity: e.opacity || .5,
            offsetx: e.offsetx || 0,
            offsety: e.offsety || 0,
            color: e.color || "#000"
        },
			n = t.width / 2,
			r = this.paper,
			i = r.set(),
			s = this.realPath || at[this.type](this);
        s = this.matrix ? ft(s, this.matrix) : s;
        for (var o = 1; o < n + 1; o++) i.push(r.path(s).attr({
            stroke: t.color,
            fill: t.fill ? t.color : "none",
            "stroke-linejoin": "round",
            "stroke-linecap": "round",
            "stroke-width": +(t.width / n * o).toFixed(3),
            opacity: +(t.opacity / n).toFixed(3)
        }));
        return i.insertBefore(this).translate(t.offsetx, t.offsety)
    };
    var yn = {},
		bn = function (t, n, r, i, s, o, u, a, f) {
		    return f == null ? kt(t, n, r, i, s, o, u, a) : e.findDotsAtSegment(t, n, r, i, s, o, u, a, Lt(t, n, r, i, s, o, u, a, f))
		},
		wn = function (t, n) {
		    return function (r, i, s) {
		        r = zt(r);
		        var o, u, a, f, l = "",
					c = {},
					h, p = 0;
		        for (var d = 0, v = r.length; d < v; d++) {
		            a = r[d];
		            if (a[0] == "M") o = +a[1], u = +a[2];
		            else {
		                f = bn(o, u, a[1], a[2], a[3], a[4], a[5], a[6]);
		                if (p + f > i) {
		                    if (n && !c.start) {
		                        h = bn(o, u, a[1], a[2], a[3], a[4], a[5], a[6], i - p), l += ["C" + h.start.x, h.start.y, h.m.x, h.m.y, h.x, h.y];
		                        if (s) return l;
		                        c.start = l, l = ["M" + h.x, h.y + "C" + h.n.x, h.n.y, h.end.x, h.end.y, a[5], a[6]].join(), p += f, o = +a[5], u = +a[6];
		                        continue
		                    }
		                    if (!t && !n) return h = bn(o, u, a[1], a[2], a[3], a[4], a[5], a[6], i - p), {
		                        x: h.x,
		                        y: h.y,
		                        alpha: h.alpha
		                    }
		                }
		                p += f, o = +a[5], u = +a[6]
		            }
		            l += a.shift() + a
		        }
		        return c.end = l, h = t ? p : n ? c : e.findDotsAtSegment(o, u, a[0], a[1], a[2], a[3], a[4], a[5], 1), h.alpha && (h = {
		            x: h.x,
		            y: h.y,
		            alpha: h.alpha
		        }), h
		    }
		},
		En = wn(1),
		Sn = wn(),
		xn = wn(0, 1);
    e.getTotalLength = En, e.getPointAtLength = Sn, e.getSubpath = function (e, t, n) {
        if (this.getTotalLength(e) - n < 1e-6) return xn(e, t).end;
        var r = xn(e, n, 1);
        return t ? xn(r, t).end : r
    }, hn.getTotalLength = function () {
        if (this.type != "path") return;
        return this.node.getTotalLength ? this.node.getTotalLength() : En(this.attrs.path)
    }, hn.getPointAtLength = function (e) {
        if (this.type != "path") return;
        return Sn(this.attrs.path, e)
    }, hn.getSubpath = function (t, n) {
        if (this.type != "path") return;
        return e.getSubpath(this.attrs.path, t, n)
    };
    var Tn = e.easing_formulas = {
        linear: function (e) {
            return e
        },
        "<": function (e) {
            return C(e, 1.7)
        },
        ">": function (e) {
            return C(e, .48)
        },
        "<>": function (e) {
            var t = .48 - e / 1.04,
				n = S.sqrt(.1734 + t * t),
				r = n - t,
				i = C(N(r), 1 / 3) * (r < 0 ? -1 : 1),
				s = -n - t,
				o = C(N(s), 1 / 3) * (s < 0 ? -1 : 1),
				u = i + o + .5;
            return (1 - u) * 3 * u * u + u * u * u
        },
        backIn: function (e) {
            var t = 1.70158;
            return e * e * ((t + 1) * e - t)
        },
        backOut: function (e) {
            e -= 1;
            var t = 1.70158;
            return e * e * ((t + 1) * e + t) + 1
        },
        elastic: function (e) {
            return e == !!e ? e : C(2, -10 * e) * S.sin((e - .075) * 2 * k / .3) + 1
        },
        bounce: function (e) {
            var t = 7.5625,
				n = 2.75,
				r;
            return e < 1 / n ? r = t * e * e : e < 2 / n ? (e -= 1.5 / n, r = t * e * e + .75) : e < 2.5 / n ? (e -= 2.25 / n, r = t * e * e + .9375) : (e -= 2.625 / n, r = t * e * e + .984375), r
        }
    };
    Tn.easeIn = Tn["ease-in"] = Tn["<"], Tn.easeOut = Tn["ease-out"] = Tn[">"], Tn.easeInOut = Tn["ease-in-out"] = Tn["<>"], Tn["back-in"] = Tn.backIn, Tn["back-out"] = Tn.backOut;
    var Nn = [],
		Cn = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
	function (e) {
	    setTimeout(e, 16)
	}, kn = function () {
	    var t = +(new Date),
			n = 0;
	    for (; n < Nn.length; n++) {
	        var r = Nn[n];
	        if (r.el.removed || r.paused) continue;
	        var i = t - r.start,
				s = r.ms,
				u = r.easing,
				a = r.from,
				f = r.diff,
				l = r.to,
				c = r.t,
				h = r.el,
				d = {},
				v, g = {},
				y;
	        r.initstatus ? (i = (r.initstatus * r.anim.top - r.prev) / (r.percent - r.prev) * s, r.status = r.initstatus, delete r.initstatus, r.stop && Nn.splice(n--, 1)) : r.status = (r.prev + (r.percent - r.prev) * (i / s)) / r.anim.top;
	        if (i < 0) continue;
	        if (i < s) {
	            var b = u(i / s);
	            for (var w in a) if (a[o](w)) {
	                switch (V[w]) {
	                    case L:
	                        v = +a[w] + b * s * f[w];
	                        break;
	                    case "colour":
	                        v = "rgb(" + [Ln(q(a[w].r + b * s * f[w].r)), Ln(q(a[w].g + b * s * f[w].g)), Ln(q(a[w].b + b * s * f[w].b))].join(",") + ")";
	                        break;
	                    case "path":
	                        v = [];
	                        for (var E = 0, S = a[w].length; E < S; E++) {
	                            v[E] = [a[w][E][0]];
	                            for (var x = 1, T = a[w][E].length; x < T; x++) v[E][x] = +a[w][E][x] + b * s * f[w][E][x];
	                            v[E] = v[E].join(m)
	                        }
	                        v = v.join(m);
	                        break;
	                    case "transform":
	                        if (f[w].real) {
	                            v = [];
	                            for (E = 0, S = a[w].length; E < S; E++) {
	                                v[E] = [a[w][E][0]];
	                                for (x = 1, T = a[w][E].length; x < T; x++) v[E][x] = a[w][E][x] + b * s * f[w][E][x]
	                            }
	                        } else {
	                            var N = function (e) {
	                                return +a[w][e] + b * s * f[w][e]
	                            };
	                            v = [
                                    ["m", N(0), N(1), N(2), N(3), N(4), N(5)]
	                            ]
	                        }
	                        break;
	                    case "csv":
	                        if (w == "clip-rect") {
	                            v = [], E = 4;
	                            while (E--) v[E] = +a[w][E] + b * s * f[w][E]
	                        }
	                        break;
	                    default:
	                        var C = [][p](a[w]);
	                        v = [], E = h.paper.customAttributes[w].length;
	                        while (E--) v[E] = +C[E] + b * s * f[w][E]
	                }
	                d[w] = v
	            }
	            h.attr(d), function (e, t, n) {
	                setTimeout(function () {
	                    eve("raphael.anim.frame." + e, t, n)
	                })
	            }(h.id, h, r.anim)
	        } else {
	            (function (t, n, r) {
	                setTimeout(function () {
	                    eve("raphael.anim.frame." + n.id, n, r), eve("raphael.anim.finish." + n.id, n, r), e.is(t, "function") && t.call(n)
	                })
	            })(r.callback, h, r.anim), h.attr(l), Nn.splice(n--, 1);
	            if (r.repeat > 1 && !r.next) {
	                for (y in l) l[o](y) && (g[y] = r.totalOrigin[y]);
	                r.el.attr(g), Mn(r.anim, r.el, r.anim.percents[0], null, r.totalOrigin, r.repeat - 1)
	            }
	            r.next && !r.stop && Mn(r.anim, r.el, r.next, null, r.totalOrigin, r.repeat)
	        }
	    }
	    e.svg && h && h.paper && h.paper.safari(), Nn.length && Cn(kn)
	}, Ln = function (e) {
	    return e > 255 ? 255 : e < 0 ? 0 : e
	};
    hn.animateWith = function (t, n, r, i, s, o) {
        var u = this;
        if (u.removed) return o && o.call(u), u;
        var a = r instanceof On ? r : e.animation(r, i, s, o),
			f, l;
        Mn(a, u, a.percents[0], null, u.attr());
        for (var c = 0, h = Nn.length; c < h; c++) if (Nn[c].anim == n && Nn[c].el == t) {
            Nn[h - 1].start = Nn[c].start;
            break
        }
        return u
    }, hn.onAnimation = function (e) {
        return e ? eve.on("raphael.anim.frame." + this.id, e) : eve.unbind("raphael.anim.frame." + this.id), this
    }, On.prototype.delay = function (e) {
        var t = new On(this.anim, this.ms);
        return t.times = this.times, t.del = +e || 0, t
    }, On.prototype.repeat = function (e) {
        var t = new On(this.anim, this.ms);
        return t.del = this.del, t.times = S.floor(x(e, 0)) || 1, t
    }, e.animation = function (t, n, r, i) {
        if (t instanceof On) return t;
        if (e.is(r, "function") || !r) i = i || r || null, r = null;
        t = Object(t), n = +n || 0;
        var s = {},
			u, a;
        for (a in t) t[o](a) && U(a) != a && U(a) + "%" != a && (u = !0, s[a] = t[a]);
        return u ? (r && (s.easing = r), i && (s.callback = i), new On({
            100: s
        }, n)) : new On(t, n)
    }, hn.animate = function (t, n, r, i) {
        var s = this;
        if (s.removed) return i && i.call(s), s;
        var o = t instanceof On ? t : e.animation(t, n, r, i);
        return Mn(o, s, o.percents[0], null, s.attr()), s
    }, hn.setTime = function (e, t) {
        return e && t != null && this.status(e, T(t, e.ms) / e.ms), this
    }, hn.status = function (e, t) {
        var n = [],
			r = 0,
			i, s;
        if (t != null) return Mn(e, this, -1, T(t, 1)), this;
        i = Nn.length;
        for (; r < i; r++) {
            s = Nn[r];
            if (s.el.id == this.id && (!e || s.anim == e)) {
                if (e) return s.status;
                n.push({
                    anim: s.anim,
                    status: s.status
                })
            }
        }
        return e ? 0 : n
    }, hn.pause = function (e) {
        for (var t = 0; t < Nn.length; t++) Nn[t].el.id == this.id && (!e || Nn[t].anim == e) && eve("raphael.anim.pause." + this.id, this, Nn[t].anim) !== !1 && (Nn[t].paused = !0);
        return this
    }, hn.resume = function (e) {
        for (var t = 0; t < Nn.length; t++) if (Nn[t].el.id == this.id && (!e || Nn[t].anim == e)) {
            var n = Nn[t];
            eve("raphael.anim.resume." + this.id, this, n.anim) !== !1 && (delete n.paused, this.status(n.anim, n.status))
        }
        return this
    }, hn.stop = function (e) {
        for (var t = 0; t < Nn.length; t++) Nn[t].el.id == this.id && (!e || Nn[t].anim == e) && eve("raphael.anim.stop." + this.id, this, Nn[t].anim) !== !1 && Nn.splice(t--, 1);
        return this
    }, eve.on("raphael.remove", _n), eve.on("raphael.clear", _n), hn.toString = function () {
        return "Rapha\u00ebl\u2019s object"
    };
    var Dn = function (e) {
        this.items = [], this.length = 0, this.type = "set";
        if (e) for (var t = 0, n = e.length; t < n; t++) e[t] && (e[t].constructor == hn.constructor || e[t].constructor == Dn) && (this[this.items.length] = this.items[this.items.length] = e[t], this.length++)
    },
		Pn = Dn.prototype;
    Pn.push = function () {
        var e, t;
        for (var n = 0, r = arguments.length; n < r; n++) e = arguments[n], e && (e.constructor == hn.constructor || e.constructor == Dn) && (t = this.items.length, this[t] = this.items[t] = e, this.length++);
        return this
    }, Pn.pop = function () {
        return this.length && delete this[this.length--], this.items.pop()
    }, Pn.forEach = function (e, t) {
        for (var n = 0, r = this.items.length; n < r; n++) if (e.call(t, this.items[n], n) === !1) return this;
        return this
    };
    for (var Hn in hn) hn[o](Hn) && (Pn[Hn] = function (e) {
        return function () {
            var t = arguments;
            return this.forEach(function (n) {
                n[e][h](n, t)
            })
        }
    }(Hn));
    Pn.attr = function (t, n) {
        if (t && e.is(t, O) && e.is(t[0], "object")) for (var r = 0, i = t.length; r < i; r++) this.items[r].attr(t[r]);
        else for (var s = 0, o = this.items.length; s < o; s++) this.items[s].attr(t, n);
        return this
    }, Pn.clear = function () {
        while (this.length) this.pop()
    }, Pn.splice = function (e, t, n) {
        e = e < 0 ? x(this.length + e, 0) : e, t = x(0, T(this.length - e, t));
        var r = [],
			i = [],
			s = [],
			o;
        for (o = 2; o < arguments.length; o++) s.push(arguments[o]);
        for (o = 0; o < t; o++) i.push(this[e + o]);
        for (; o < this.length - e; o++) r.push(this[e + o]);
        var u = s.length;
        for (o = 0; o < u + r.length; o++) this.items[e + o] = this[e + o] = o < u ? s[o] : r[o - u];
        o = this.items.length = this.length -= t - u;
        while (this[o]) delete this[o++];
        return new Dn(i)
    }, Pn.exclude = function (e) {
        for (var t = 0, n = this.length; t < n; t++) if (this[t] == e) return this.splice(t, 1), !0
    }, Pn.animate = function (t, n, r, i) {
        (e.is(r, "function") || !r) && (i = r || null);
        var s = this.items.length,
			o = s,
			u, a = this,
			f;
        if (!s) return this;
        i && (f = function () {
            !--s && i.call(a)
        }), r = e.is(r, A) ? r : f;
        var l = e.animation(t, n, r, f);
        u = this.items[--o].animate(l);
        while (o--) this.items[o] && !this.items[o].removed && this.items[o].animateWith(u, l, l);
        return this
    }, Pn.insertAfter = function (e) {
        var t = this.items.length;
        while (t--) this.items[t].insertAfter(e);
        return this
    }, Pn.getBBox = function () {
        var e = [],
			t = [],
			n = [],
			r = [];
        for (var i = this.items.length; i--;) if (!this.items[i].removed) {
            var s = this.items[i].getBBox();
            e.push(s.x), t.push(s.y), n.push(s.x + s.width), r.push(s.y + s.height)
        }
        return e = T[h](0, e), t = T[h](0, t), n = x[h](0, n), r = x[h](0, r), {
            x: e,
            y: t,
            x2: n,
            y2: r,
            width: n - e,
            height: r - t
        }
    }, Pn.clone = function (e) {
        e = this.paper.set();
        for (var t = 0, n = this.items.length; t < n; t++) e.push(this.items[t].clone());
        return e
    }, Pn.toString = function () {
        return "Rapha\u00ebl\u2018s set"
    }, Pn.glow = function (e) {
        var t = this.paper.set();
        return this.forEach(function (n, r) {
            var i = n.glow(e);
            i != null && i.forEach(function (e, n) {
                t.push(e)
            })
        }), t
    }, e.registerFont = function (e) {
        if (!e.face) return e;
        this.fonts = this.fonts || {};
        var t = {
            w: e.w,
            face: {},
            glyphs: {}
        },
			n = e.face["font-family"];
        for (var r in e.face) e.face[o](r) && (t.face[r] = e.face[r]);
        this.fonts[n] ? this.fonts[n].push(t) : this.fonts[n] = [t];
        if (!e.svg) {
            t.face["units-per-em"] = z(e.face["units-per-em"], 10);
            for (var i in e.glyphs) if (e.glyphs[o](i)) {
                var s = e.glyphs[i];
                t.glyphs[i] = {
                    w: s.w,
                    k: {},
                    d: s.d && "M" + s.d.replace(/[mlcxtrv]/g, function (e) {
                        return {
                            l: "L",
                            c: "C",
                            x: "z",
                            t: "m",
                            r: "l",
                            v: "c"
                        }[e] || "M"
                    }) + "z"
                };
                if (s.k) for (var u in s.k) s[o](u) && (t.glyphs[i].k[u] = s.k[u])
            }
        }
        return e
    }, l.getFont = function (t, n, r, i) {
        i = i || "normal", r = r || "normal", n = +n || {
            normal: 400,
            bold: 700,
            lighter: 300,
            bolder: 800
        }[n] || 400;
        if (!e.fonts) return;
        var s = e.fonts[t];
        if (!s) {
            var u = new RegExp("(^|\\s)" + t.replace(/[^\w\d\s+!~.:_-]/g, v) + "(\\s|$)", "i");
            for (var a in e.fonts) if (e.fonts[o](a) && u.test(a)) {
                s = e.fonts[a];
                break
            }
        }
        var f;
        if (s) for (var l = 0, c = s.length; l < c; l++) {
            f = s[l];
            if (f.face["font-weight"] == n && (f.face["font-style"] == r || !f.face["font-style"]) && f.face["font-stretch"] == i) break
        }
        return f
    }, l.print = function (t, r, i, s, o, u, a) {
        u = u || "middle", a = x(T(a || 0, 1), -1);
        var f = g(i)[y](v),
			l = 0,
			c = 0,
			h = v,
			p;
        e.is(s, "string") && (s = this.getFont(s));
        if (s) {
            p = (o || 16) / s.face["units-per-em"];
            var d = s.face.bbox[y](n),
				m = +d[0],
				b = d[3] - d[1],
				w = 0,
				E = +d[1] + (u == "baseline" ? b + +s.face.descent : b / 2);
            for (var S = 0, N = f.length; S < N; S++) {
                if (f[S] == "\n") l = 0, k = 0, c = 0, w += b;
                else {
                    var C = c && s.glyphs[f[S - 1]] || {},
						k = s.glyphs[f[S]];
                    l += c ? (C.w || s.w) + (C.k && C.k[f[S]] || 0) + s.w * a : 0, c = 1
                }
                k && k.d && (h += e.transformPath(k.d, ["t", l * p, w * p, "s", p, p, m, E, "t", (t - m) / p, (r - E) / p]))
            }
        }
        return this.path(h).attr({
            fill: "#000",
            stroke: "none"
        })
    }, l.add = function (t) {
        if (e.is(t, "array")) {
            var n = this.set(),
				i = 0,
				s = t.length,
				u;
            for (; i < s; i++) u = t[i] || {}, r[o](u.type) && n.push(this[u.type]().attr(u))
        }
        return n
    }, e.format = function (t, n) {
        var r = e.is(n, O) ? [0][p](n) : arguments;
        return t && e.is(t, A) && r.length - 1 && (t = t.replace(i, function (e, t) {
            return r[++t] == null ? v : r[t]
        })), t || v
    }, e.fullfill = function () {
        var e = /\{([^\}]+)\}/g,
			t = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,
			n = function (e, n, r) {
			    var i = r;
			    return n.replace(t, function (e, t, n, r, s) {
			        t = t || r, i && (t in i && (i = i[t]), typeof i == "function" && s && (i = i()))
			    }), i = (i == null || i == r ? e : i) + "", i
			};
        return function (t, r) {
            return String(t).replace(e, function (e, t) {
                return n(e, t, r)
            })
        }
    }(), e.ninja = function () {
        return a.was ? u.win.Raphael = a.is : delete Raphael, e
    }, e.st = Pn, function (t, n, r) {
        function i() {
            /in/.test(t.readyState) ? setTimeout(i, 9) : e.eve("raphael.DOMload")
        }
        t.readyState == null && t.addEventListener && (t.addEventListener(n, r = function () {
            t.removeEventListener(n, r, !1), t.readyState = "complete"
        }, !1), t.readyState = "loading"), i()
    }(document, "DOMContentLoaded"), a.was ? u.win.Raphael = e : Raphael = e, eve.on("raphael.DOMload", function () {
        t = !0
    })
}(), window.Raphael && window.Raphael.svg &&
function (e) {
    var t = "hasOwnProperty",
		n = String,
		r = parseFloat,
		i = parseInt,
		s = Math,
		o = s.max,
		u = s.abs,
		a = s.pow,
		f = /[, ]+/,
		l = e.eve,
		c = "",
		h = " ",
		p = "http://www.w3.org/1999/xlink",
		d = {
		    block: "M5,0 0,2.5 5,5z",
		    classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z",
		    diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z",
		    open: "M6,1 1,3.5 6,6",
		    oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"
		},
		v = {};
    e.toString = function () {
        return "Your browser supports SVG.\nYou are running Rapha\u00ebl " + this.version
    };
    var m = function (r, i) {
        if (i) {
            typeof r == "string" && (r = m(r));
            for (var s in i) i[t](s) && (s.substring(0, 6) == "xlink:" ? r.setAttributeNS(p, s.substring(6), n(i[s])) : r.setAttribute(s, n(i[s])))
        } else r = e._g.doc.createElementNS("http://www.w3.org/2000/svg", r), r.style && (r.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
        return r
    },
		g = function (t, i) {
		    var f = "linear",
				l = t.id + i,
				h = .5,
				p = .5,
				d = t.node,
				v = t.paper,
				g = d.style,
				y = e._g.doc.getElementById(l);
		    if (!y) {
		        i = n(i).replace(e._radial_gradient, function (e, t, n) {
		            f = "radial";
		            if (t && n) {
		                h = r(t), p = r(n);
		                var i = (p > .5) * 2 - 1;
		                a(h - .5, 2) + a(p - .5, 2) > .25 && (p = s.sqrt(.25 - a(h - .5, 2)) * i + .5) && p != .5 && (p = p.toFixed(5) - 1e-5 * i)
		            }
		            return c
		        }), i = i.split(/\s*\-\s*/);
		        if (f == "linear") {
		            var b = i.shift();
		            b = -r(b);
		            if (isNaN(b)) return null;
		            var w = [0, 0, s.cos(e.rad(b)), s.sin(e.rad(b))],
						E = 1 / (o(u(w[2]), u(w[3])) || 1);
		            w[2] *= E, w[3] *= E, w[2] < 0 && (w[0] = -w[2], w[2] = 0), w[3] < 0 && (w[1] = -w[3], w[3] = 0)
		        }
		        var S = e._parseDots(i);
		        if (!S) return null;
		        l = l.replace(/[\(\)\s,\xb0#]/g, "_"), t.gradient && l != t.gradient.id && (v.defs.removeChild(t.gradient), delete t.gradient);
		        if (!t.gradient) {
		            y = m(f + "Gradient", {
		                id: l
		            }), t.gradient = y, m(y, f == "radial" ? {
		                fx: h,
		                fy: p
		            } : {
		                x1: w[0],
		                y1: w[1],
		                x2: w[2],
		                y2: w[3],
		                gradientTransform: t.matrix.invert()
		            }), v.defs.appendChild(y);
		            for (var x = 0, T = S.length; x < T; x++) y.appendChild(m("stop", {
		                offset: S[x].offset ? S[x].offset : x ? "100%" : "0%",
		                "stop-color": S[x].color || "#fff"
		            }))
		        }
		    }
		    return m(d, {
		        fill: "url(#" + l + ")",
		        opacity: 1,
		        "fill-opacity": 1
		    }), g.fill = c, g.opacity = 1, g.fillOpacity = 1, 1
		},
		y = function (e) {
		    var t = e.getBBox(1);
		    m(e.pattern, {
		        patternTransform: e.matrix.invert() + " translate(" + t.x + "," + t.y + ")"
		    })
		},
		b = function (r, i, s) {
		    if (r.type == "path") {
		        var o = n(i).toLowerCase().split("-"),
					u = r.paper,
					a = s ? "end" : "start",
					f = r.node,
					l = r.attrs,
					h = l["stroke-width"],
					p = o.length,
					g = "classic",
					y, b, w, E, S, x = 3,
					T = 3,
					N = 5;
		        while (p--) switch (o[p]) {
		            case "block":
		            case "classic":
		            case "oval":
		            case "diamond":
		            case "open":
		            case "none":
		                g = o[p];
		                break;
		            case "wide":
		                T = 5;
		                break;
		            case "narrow":
		                T = 2;
		                break;
		            case "long":
		                x = 5;
		                break;
		            case "short":
		                x = 2
		        }
		        g == "open" ? (x += 2, T += 2, N += 2, w = 1, E = s ? 4 : 1, S = {
		            fill: "none",
		            stroke: l.stroke
		        }) : (E = w = x / 2, S = {
		            fill: l.stroke,
		            stroke: "none"
		        }), r._.arrows ? s ? (r._.arrows.endPath && v[r._.arrows.endPath]--, r._.arrows.endMarker && v[r._.arrows.endMarker]--) : (r._.arrows.startPath && v[r._.arrows.startPath]--, r._.arrows.startMarker && v[r._.arrows.startMarker]--) : r._.arrows = {};
		        if (g != "none") {
		            var C = "raphael-marker-" + g,
						k = "raphael-marker-" + a + g + x + T;
		            e._g.doc.getElementById(C) ? v[C]++ : (u.defs.appendChild(m(m("path"), {
		                "stroke-linecap": "round",
		                d: d[g],
		                id: C
		            })), v[C] = 1);
		            var L = e._g.doc.getElementById(k),
						A;
		            L ? (v[k]++, A = L.getElementsByTagName("use")[0]) : (L = m(m("marker"), {
		                id: k,
		                markerHeight: T,
		                markerWidth: x,
		                orient: "auto",
		                refX: E,
		                refY: T / 2
		            }), A = m(m("use"), {
		                "xlink:href": "#" + C,
		                transform: (s ? "rotate(180 " + x / 2 + " " + T / 2 + ") " : c) + "scale(" + x / N + "," + T / N + ")",
		                "stroke-width": (1 / ((x / N + T / N) / 2)).toFixed(4)
		            }), L.appendChild(A), u.defs.appendChild(L), v[k] = 1), m(A, S);
		            var O = w * (g != "diamond" && g != "oval");
		            s ? (y = r._.arrows.startdx * h || 0, b = e.getTotalLength(l.path) - O * h) : (y = O * h, b = e.getTotalLength(l.path) - (r._.arrows.enddx * h || 0)), S = {}, S["marker-" + a] = "url(#" + k + ")";
		            if (b || y) S.d = Raphael.getSubpath(l.path, y, b);
		            m(f, S), r._.arrows[a + "Path"] = C, r._.arrows[a + "Marker"] = k, r._.arrows[a + "dx"] = O, r._.arrows[a + "Type"] = g, r._.arrows[a + "String"] = i
		        } else s ? (y = r._.arrows.startdx * h || 0, b = e.getTotalLength(l.path) - y) : (y = 0, b = e.getTotalLength(l.path) - (r._.arrows.enddx * h || 0)), r._.arrows[a + "Path"] && m(f, {
		            d: Raphael.getSubpath(l.path, y, b)
		        }), delete r._.arrows[a + "Path"], delete r._.arrows[a + "Marker"], delete r._.arrows[a + "dx"], delete r._.arrows[a + "Type"], delete r._.arrows[a + "String"];
		        for (S in v) if (v[t](S) && !v[S]) {
		            var M = e._g.doc.getElementById(S);
		            M && M.parentNode.removeChild(M)
		        }
		    }
		},
		w = {
		    "": [0],
		    none: [0],
		    "-": [3, 1],
		    ".": [1, 1],
		    "-.": [3, 1, 1, 1],
		    "-..": [3, 1, 1, 1, 1, 1],
		    ". ": [1, 3],
		    "- ": [4, 3],
		    "--": [8, 3],
		    "- .": [4, 3, 1, 3],
		    "--.": [8, 3, 1, 3],
		    "--..": [8, 3, 1, 3, 1, 3]
		},
		E = function (e, t, r) {
		    t = w[n(t).toLowerCase()];
		    if (t) {
		        var i = e.attrs["stroke-width"] || "1",
					s = {
					    round: i,
					    square: i,
					    butt: 0
					}[e.attrs["stroke-linecap"] || r["stroke-linecap"]] || 0,
					o = [],
					u = t.length;
		        while (u--) o[u] = t[u] * i + (u % 2 ? 1 : -1) * s;
		        m(e.node, {
		            "stroke-dasharray": o.join(",")
		        })
		    }
		},
		S = function (r, s) {
		    var a = r.node,
				l = r.attrs,
				h = a.style.visibility;
		    a.style.visibility = "hidden";
		    for (var d in s) if (s[t](d)) {
		        if (!e._availableAttrs[t](d)) continue;
		        var v = s[d];
		        l[d] = v;
		        switch (d) {
		            case "blur":
		                r.blur(v);
		                break;
		            case "href":
		            case "title":
		            case "target":
		                var w = a.parentNode;
		                if (w.tagName.toLowerCase() != "a") {
		                    var S = m("a");
		                    w.insertBefore(S, a), S.appendChild(a), w = S
		                }
		                d == "target" ? w.setAttributeNS(p, "show", v == "blank" ? "new" : v) : w.setAttributeNS(p, d, v);
		                break;
		            case "cursor":
		                a.style.cursor = v;
		                break;
		            case "transform":
		                r.transform(v);
		                break;
		            case "arrow-start":
		                b(r, v);
		                break;
		            case "arrow-end":
		                b(r, v, 1);
		                break;
		            case "clip-rect":
		                var x = n(v).split(f);
		                if (x.length == 4) {
		                    r.clip && r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);
		                    var N = m("clipPath"),
                                C = m("rect");
		                    N.id = e.createUUID(), m(C, {
		                        x: x[0],
		                        y: x[1],
		                        width: x[2],
		                        height: x[3]
		                    }), N.appendChild(C), r.paper.defs.appendChild(N), m(a, {
		                        "clip-path": "url(#" + N.id + ")"
		                    }), r.clip = C
		                }
		                if (!v) {
		                    var k = a.getAttribute("clip-path");
		                    if (k) {
		                        var L = e._g.doc.getElementById(k.replace(/(^url\(#|\)$)/g, c));
		                        L && L.parentNode.removeChild(L), m(a, {
		                            "clip-path": c
		                        }), delete r.clip
		                    }
		                }
		                break;
		            case "path":
		                r.type == "path" && (m(a, {
		                    d: v ? l.path = e._pathToAbsolute(v) : "M0,0"
		                }), r._.dirty = 1, r._.arrows && ("startString" in r._.arrows && b(r, r._.arrows.startString), "endString" in r._.arrows && b(r, r._.arrows.endString, 1)));
		                break;
		            case "width":
		                a.setAttribute(d, v), r._.dirty = 1;
		                if (!l.fx) break;
		                d = "x", v = l.x;
		            case "x":
		                l.fx && (v = -l.x - (l.width || 0));
		            case "rx":
		                if (d == "rx" && r.type == "rect") break;
		            case "cx":
		                a.setAttribute(d, v), r.pattern && y(r), r._.dirty = 1;
		                break;
		            case "height":
		                a.setAttribute(d, v), r._.dirty = 1;
		                if (!l.fy) break;
		                d = "y", v = l.y;
		            case "y":
		                l.fy && (v = -l.y - (l.height || 0));
		            case "ry":
		                if (d == "ry" && r.type == "rect") break;
		            case "cy":
		                a.setAttribute(d, v), r.pattern && y(r), r._.dirty = 1;
		                break;
		            case "r":
		                r.type == "rect" ? m(a, {
		                    rx: v,
		                    ry: v
		                }) : a.setAttribute(d, v), r._.dirty = 1;
		                break;
		            case "src":
		                r.type == "image" && a.setAttributeNS(p, "href", v);
		                break;
		            case "stroke-width":
		                if (r._.sx != 1 || r._.sy != 1) v /= o(u(r._.sx), u(r._.sy)) || 1;
		                r.paper._vbSize && (v *= r.paper._vbSize), a.setAttribute(d, v), l["stroke-dasharray"] && E(r, l["stroke-dasharray"], s), r._.arrows && ("startString" in r._.arrows && b(r, r._.arrows.startString), "endString" in r._.arrows && b(r, r._.arrows.endString, 1));
		                break;
		            case "stroke-dasharray":
		                E(r, v, s);
		                break;
		            case "fill":
		                var A = n(v).match(e._ISURL);
		                if (A) {
		                    N = m("pattern");
		                    var O = m("image");
		                    N.id = e.createUUID(), m(N, {
		                        x: 0,
		                        y: 0,
		                        patternUnits: "userSpaceOnUse",
		                        height: 1,
		                        width: 1
		                    }), m(O, {
		                        x: 0,
		                        y: 0,
		                        "xlink:href": A[1]
		                    }), N.appendChild(O), function (t) {
		                        e._preload(A[1], function () {
		                            var e = this.offsetWidth,
                                        n = this.offsetHeight;
		                            m(t, {
		                                width: e,
		                                height: n
		                            }), m(O, {
		                                width: e,
		                                height: n
		                            }), r.paper.safari()
		                        })
		                    }(N), r.paper.defs.appendChild(N), m(a, {
		                        fill: "url(#" + N.id + ")"
		                    }), r.pattern = N, r.pattern && y(r);
		                    break
		                }
		                var M = e.getRGB(v);
		                if (!M.error) delete s.gradient, delete l.gradient, !e.is(l.opacity, "undefined") && e.is(s.opacity, "undefined") && m(a, {
		                    opacity: l.opacity
		                }), !e.is(l["fill-opacity"], "undefined") && e.is(s["fill-opacity"], "undefined") && m(a, {
		                    "fill-opacity": l["fill-opacity"]
		                });
		                else if ((r.type == "circle" || r.type == "ellipse" || n(v).charAt() != "r") && g(r, v)) {
		                    if ("opacity" in l || "fill-opacity" in l) {
		                        var _ = e._g.doc.getElementById(a.getAttribute("fill").replace(/^url\(#|\)$/g, c));
		                        if (_) {
		                            var D = _.getElementsByTagName("stop");
		                            m(D[D.length - 1], {
		                                "stop-opacity": ("opacity" in l ? l.opacity : 1) * ("fill-opacity" in l ? l["fill-opacity"] : 1)
		                            })
		                        }
		                    }
		                    l.gradient = v, l.fill = "none";
		                    break
		                }
		                M[t]("opacity") && m(a, {
		                    "fill-opacity": M.opacity > 1 ? M.opacity / 100 : M.opacity
		                });
		            case "stroke":
		                M = e.getRGB(v), a.setAttribute(d, M.hex), d == "stroke" && M[t]("opacity") && m(a, {
		                    "stroke-opacity": M.opacity > 1 ? M.opacity / 100 : M.opacity
		                }), d == "stroke" && r._.arrows && ("startString" in r._.arrows && b(r, r._.arrows.startString), "endString" in r._.arrows && b(r, r._.arrows.endString, 1));
		                break;
		            case "gradient":
		                (r.type == "circle" || r.type == "ellipse" || n(v).charAt() != "r") && g(r, v);
		                break;
		            case "opacity":
		                l.gradient && !l[t]("stroke-opacity") && m(a, {
		                    "stroke-opacity": v > 1 ? v / 100 : v
		                });
		            case "fill-opacity":
		                if (l.gradient) {
		                    _ = e._g.doc.getElementById(a.getAttribute("fill").replace(/^url\(#|\)$/g, c)), _ && (D = _.getElementsByTagName("stop"), m(D[D.length - 1], {
		                        "stop-opacity": v
		                    }));
		                    break
		                };
		            default:
		                d == "font-size" && (v = i(v, 10) + "px");
		                var P = d.replace(/(\-.)/g, function (e) {
		                    return e.substring(1).toUpperCase()
		                });
		                a.style[P] = v, r._.dirty = 1, a.setAttribute(d, v)
		        }
		    }
		    T(r, s), a.style.visibility = h
		},
		x = 1.2,
		T = function (r, s) {
		    if (r.type != "text" || !(s[t]("text") || s[t]("font") || s[t]("font-size") || s[t]("x") || s[t]("y"))) return;
		    var o = r.attrs,
				u = r.node,
				a = u.firstChild ? i(e._g.doc.defaultView.getComputedStyle(u.firstChild, c).getPropertyValue("font-size"), 10) : 10;
		    if (s[t]("text")) {
		        o.text = s.text;
		        while (u.firstChild) u.removeChild(u.firstChild);
		        var f = n(s.text).split("\n"),
					l = [],
					h;
		        for (var p = 0, d = f.length; p < d; p++) h = m("tspan"), p && m(h, {
		            dy: a * x,
		            x: o.x
		        }), h.appendChild(e._g.doc.createTextNode(f[p])), u.appendChild(h), l[p] = h
		    } else {
		        l = u.getElementsByTagName("tspan");
		        for (p = 0, d = l.length; p < d; p++) p ? m(l[p], {
		            dy: a * x,
		            x: o.x
		        }) : m(l[0], {
		            dy: 0
		        })
		    }
		    m(u, {
		        x: o.x,
		        y: o.y
		    }), r._.dirty = 1;
		    var v = r._getBBox(),
				g = o.y - (v.y + v.height / 2);
		    g && e.is(g, "finite") && m(l[0], {
		        dy: g
		    })
		},
		N = function (t, n) {
		    var r = 0,
				i = 0;
		    this[0] = this.node = t, t.raphael = !0, this.id = e._oid++, t.raphaelid = this.id, this.matrix = e.matrix(), this.realPath = null, this.paper = n, this.attrs = this.attrs || {}, this._ = {
		        transform: [],
		        sx: 1,
		        sy: 1,
		        deg: 0,
		        dx: 0,
		        dy: 0,
		        dirty: 1
		    }, !n.bottom && (n.bottom = this), this.prev = n.top, n.top && (n.top.next = this), n.top = this, this.next = null
		},
		C = e.el;
    N.prototype = C, C.constructor = N, e._engine.path = function (e, t) {
        var n = m("path");
        t.canvas && t.canvas.appendChild(n);
        var r = new N(n, t);
        return r.type = "path", S(r, {
            fill: "none",
            stroke: "#000",
            path: e
        }), r
    }, C.rotate = function (e, t, i) {
        if (this.removed) return this;
        e = n(e).split(f), e.length - 1 && (t = r(e[1]), i = r(e[2])), e = r(e[0]), i == null && (t = i);
        if (t == null || i == null) {
            var s = this.getBBox(1);
            t = s.x + s.width / 2, i = s.y + s.height / 2
        }
        return this.transform(this._.transform.concat([
			["r", e, t, i]
        ])), this
    }, C.scale = function (e, t, i, s) {
        if (this.removed) return this;
        e = n(e).split(f), e.length - 1 && (t = r(e[1]), i = r(e[2]), s = r(e[3])), e = r(e[0]), t == null && (t = e), s == null && (i = s);
        if (i == null || s == null) var o = this.getBBox(1);
        return i = i == null ? o.x + o.width / 2 : i, s = s == null ? o.y + o.height / 2 : s, this.transform(this._.transform.concat([
			["s", e, t, i, s]
        ])), this
    }, C.translate = function (e, t) {
        return this.removed ? this : (e = n(e).split(f), e.length - 1 && (t = r(e[1])), e = r(e[0]) || 0, t = +t || 0, this.transform(this._.transform.concat([
			["t", e, t]
        ])), this)
    }, C.transform = function (n) {
        var r = this._;
        if (n == null) return r.transform;
        e._extractTransform(this, n), this.clip && m(this.clip, {
            transform: this.matrix.invert()
        }), this.pattern && y(this), this.node && m(this.node, {
            transform: this.matrix
        });
        if (r.sx != 1 || r.sy != 1) {
            var i = this.attrs[t]("stroke-width") ? this.attrs["stroke-width"] : 1;
            this.attr({
                "stroke-width": i
            })
        }
        return this
    }, C.hide = function () {
        return !this.removed && this.paper.safari(this.node.style.display = "none"), this
    }, C.show = function () {
        return !this.removed && this.paper.safari(this.node.style.display = ""), this
    }, C.remove = function () {
        if (this.removed || !this.node.parentNode) return;
        var t = this.paper;
        t.__set__ && t.__set__.exclude(this), l.unbind("raphael.*.*." + this.id), this.gradient && t.defs.removeChild(this.gradient), e._tear(this, t), this.node.parentNode.tagName.toLowerCase() == "a" ? this.node.parentNode.parentNode.removeChild(this.node.parentNode) : this.node.parentNode.removeChild(this.node);
        for (var n in this) this[n] = typeof this[n] == "function" ? e._removedFactory(n) : null;
        this.removed = !0
    }, C._getBBox = function () {
        if (this.node.style.display == "none") {
            this.show();
            var e = !0
        }
        var t = {};
        try {
            t = this.node.getBBox()
        } catch (n) { } finally {
            t = t || {}
        }
        return e && this.hide(), t
    }, C.attr = function (n, r) {
        if (this.removed) return this;
        if (n == null) {
            var i = {};
            for (var s in this.attrs) this.attrs[t](s) && (i[s] = this.attrs[s]);
            return i.gradient && i.fill == "none" && (i.fill = i.gradient) && delete i.gradient, i.transform = this._.transform, i
        }
        if (r == null && e.is(n, "string")) {
            if (n == "fill" && this.attrs.fill == "none" && this.attrs.gradient) return this.attrs.gradient;
            if (n == "transform") return this._.transform;
            var o = n.split(f),
				u = {};
            for (var a = 0, c = o.length; a < c; a++) n = o[a], n in this.attrs ? u[n] = this.attrs[n] : e.is(this.paper.customAttributes[n], "function") ? u[n] = this.paper.customAttributes[n].def : u[n] = e._availableAttrs[n];
            return c - 1 ? u : u[o[0]]
        }
        if (r == null && e.is(n, "array")) {
            u = {};
            for (a = 0, c = n.length; a < c; a++) u[n[a]] = this.attr(n[a]);
            return u
        }
        if (r != null) {
            var h = {};
            h[n] = r
        } else n != null && e.is(n, "object") && (h = n);
        for (var p in h) l("raphael.attr." + p + "." + this.id, this, h[p]);
        for (p in this.paper.customAttributes) if (this.paper.customAttributes[t](p) && h[t](p) && e.is(this.paper.customAttributes[p], "function")) {
            var d = this.paper.customAttributes[p].apply(this, [].concat(h[p]));
            this.attrs[p] = h[p];
            for (var v in d) d[t](v) && (h[v] = d[v])
        }
        return S(this, h), this
    }, C.toFront = function () {
        if (this.removed) return this;
        this.node.parentNode.tagName.toLowerCase() == "a" ? this.node.parentNode.parentNode.appendChild(this.node.parentNode) : this.node.parentNode.appendChild(this.node);
        var t = this.paper;
        return t.top != this && e._tofront(this, t), this
    }, C.toBack = function () {
        if (this.removed) return this;
        var t = this.node.parentNode;
        t.tagName.toLowerCase() == "a" ? t.parentNode.insertBefore(this.node.parentNode, this.node.parentNode.parentNode.firstChild) : t.firstChild != this.node && t.insertBefore(this.node, this.node.parentNode.firstChild), e._toback(this, this.paper);
        var n = this.paper;
        return this
    }, C.insertAfter = function (t) {
        if (this.removed) return this;
        var n = t.node || t[t.length - 1].node;
        return n.nextSibling ? n.parentNode.insertBefore(this.node, n.nextSibling) : n.parentNode.appendChild(this.node), e._insertafter(this, t, this.paper), this
    }, C.insertBefore = function (t) {
        if (this.removed) return this;
        var n = t.node || t[0].node;
        return n.parentNode.insertBefore(this.node, n), e._insertbefore(this, t, this.paper), this
    }, C.blur = function (t) {
        var n = this;
        if (+t !== 0) {
            var r = m("filter"),
				i = m("feGaussianBlur");
            n.attrs.blur = t, r.id = e.createUUID(), m(i, {
                stdDeviation: +t || 1.5
            }), r.appendChild(i), n.paper.defs.appendChild(r), n._blur = r, m(n.node, {
                filter: "url(#" + r.id + ")"
            })
        } else n._blur && (n._blur.parentNode.removeChild(n._blur), delete n._blur, delete n.attrs.blur), n.node.removeAttribute("filter")
    }, e._engine.circle = function (e, t, n, r) {
        var i = m("circle");
        e.canvas && e.canvas.appendChild(i);
        var s = new N(i, e);
        return s.attrs = {
            cx: t,
            cy: n,
            r: r,
            fill: "none",
            stroke: "#000"
        }, s.type = "circle", m(i, s.attrs), s
    }, e._engine.rect = function (e, t, n, r, i, s) {
        var o = m("rect");
        e.canvas && e.canvas.appendChild(o);
        var u = new N(o, e);
        return u.attrs = {
            x: t,
            y: n,
            width: r,
            height: i,
            r: s || 0,
            rx: s || 0,
            ry: s || 0,
            fill: "none",
            stroke: "#000"
        }, u.type = "rect", m(o, u.attrs), u
    }, e._engine.ellipse = function (e, t, n, r, i) {
        var s = m("ellipse");
        e.canvas && e.canvas.appendChild(s);
        var o = new N(s, e);
        return o.attrs = {
            cx: t,
            cy: n,
            rx: r,
            ry: i,
            fill: "none",
            stroke: "#000"
        }, o.type = "ellipse", m(s, o.attrs), o
    }, e._engine.image = function (e, t, n, r, i, s) {
        var o = m("image");
        m(o, {
            x: n,
            y: r,
            width: i,
            height: s,
            preserveAspectRatio: "none"
        }), o.setAttributeNS(p, "href", t), e.canvas && e.canvas.appendChild(o);
        var u = new N(o, e);
        return u.attrs = {
            x: n,
            y: r,
            width: i,
            height: s,
            src: t
        }, u.type = "image", u
    }, e._engine.text = function (t, n, r, i) {
        var s = m("text");
        t.canvas && t.canvas.appendChild(s);
        var o = new N(s, t);
        return o.attrs = {
            x: n,
            y: r,
            "text-anchor": "middle",
            text: i,
            font: e._availableAttrs.font,
            stroke: "none",
            fill: "#000"
        }, o.type = "text", S(o, o.attrs), o
    }, e._engine.setSize = function (e, t) {
        return this.width = e || this.width, this.height = t || this.height, this.canvas.setAttribute("width", this.width), this.canvas.setAttribute("height", this.height), this._viewBox && this.setViewBox.apply(this, this._viewBox), this
    }, e._engine.create = function () {
        var t = e._getContainer.apply(0, arguments),
			n = t && t.container,
			r = t.x,
			i = t.y,
			s = t.width,
			o = t.height;
        if (!n) throw new Error("SVG container not found.");
        var u = m("svg"),
			a = "overflow:hidden;",
			f;
        return r = r || 0, i = i || 0, s = s || 512, o = o || 342, m(u, {
            height: o,
            version: 1.1,
            width: s,
            xmlns: "http://www.w3.org/2000/svg"
        }), n == 1 ? (u.style.cssText = a + "position:absolute;left:" + r + "px;top:" + i + "px", e._g.doc.body.appendChild(u), f = 1) : (u.style.cssText = a + "position:relative", n.firstChild ? n.insertBefore(u, n.firstChild) : n.appendChild(u)), n = new e._Paper, n.width = s, n.height = o, n.canvas = u, n.clear(), n._left = n._top = 0, f && (n.renderfix = function () { }), n.renderfix(), n
    }, e._engine.setViewBox = function (e, t, n, r, i) {
        l("raphael.setViewBox", this, this._viewBox, [e, t, n, r, i]);
        var s = o(n / this.width, r / this.height),
			u = this.top,
			a = i ? "meet" : "xMinYMin",
			f, c;
        e == null ? (this._vbSize && (s = 1), delete this._vbSize, f = "0 0 " + this.width + h + this.height) : (this._vbSize = s, f = e + h + t + h + n + h + r), m(this.canvas, {
            viewBox: f,
            preserveAspectRatio: a
        });
        while (s && u) c = "stroke-width" in u.attrs ? u.attrs["stroke-width"] : 1, u.attr({
            "stroke-width": c
        }), u._.dirty = 1, u._.dirtyT = 1, u = u.prev;
        return this._viewBox = [e, t, n, r, !!i], this
    }, e.prototype.renderfix = function () {
        var e = this.canvas,
			t = e.style,
			n;
        try {
            n = e.getScreenCTM() || e.createSVGMatrix()
        } catch (r) {
            n = e.createSVGMatrix()
        }
        var i = -n.e % 1,
			s = -n.f % 1;
        if (i || s) i && (this._left = (this._left + i) % 1, t.left = this._left + "px"), s && (this._top = (this._top + s) % 1, t.top = this._top + "px")
    }, e.prototype.clear = function () {
        e.eve("raphael.clear", this);
        var t = this.canvas;
        while (t.firstChild) t.removeChild(t.firstChild);
        this.bottom = this.top = null, (this.desc = m("desc")).appendChild(e._g.doc.createTextNode("Created with Rapha\u00ebl " + e.version)), t.appendChild(this.desc), t.appendChild(this.defs = m("defs"))
    }, e.prototype.remove = function () {
        l("raphael.remove", this), this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
        for (var t in this) this[t] = typeof this[t] == "function" ? e._removedFactory(t) : null
    };
    var k = e.st;
    for (var L in C) C[t](L) && !k[t](L) && (k[L] = function (e) {
        return function () {
            var t = arguments;
            return this.forEach(function (n) {
                n[e].apply(n, t)
            })
        }
    }(L))
}(window.Raphael), window.Raphael && window.Raphael.vml &&
function (e) {
    var t = "hasOwnProperty",
		n = String,
		r = parseFloat,
		i = Math,
		s = i.round,
		o = i.max,
		u = i.min,
		a = i.abs,
		f = "fill",
		l = /[, ]+/,
		c = e.eve,
		h = " progid:DXImageTransform.Microsoft",
		p = " ",
		d = "",
		v = {
		    M: "m",
		    L: "l",
		    C: "c",
		    Z: "x",
		    m: "t",
		    l: "r",
		    c: "v",
		    z: "x"
		},
		m = /([clmz]),?([^clmz]*)/gi,
		g = / progid:\S+Blur\([^\)]+\)/g,
		y = /-?[^,\s-]+/g,
		b = "position:absolute;left:0;top:0;width:1px;height:1px",
		w = 21600,
		E = {
		    path: 1,
		    rect: 1,
		    image: 1
		},
		S = {
		    circle: 1,
		    ellipse: 1
		},
		x = function (t) {
		    var r = /[ahqstv]/ig,
				i = e._pathToAbsolute;
		    n(t).match(r) && (i = e._path2curve), r = /[clmz]/g;
		    if (i == e._pathToAbsolute && !n(t).match(r)) {
		        var o = n(t).replace(m, function (e, t, n) {
		            var r = [],
						i = t.toLowerCase() == "m",
						o = v[t];
		            return n.replace(y, function (e) {
		                i && r.length == 2 && (o += r + v[t == "m" ? "l" : "L"], r = []), r.push(s(e * w))
		            }), o + r
		        });
		        return o
		    }
		    var u = i(t),
				a, f;
		    o = [];
		    for (var l = 0, c = u.length; l < c; l++) {
		        a = u[l], f = u[l][0].toLowerCase(), f == "z" && (f = "x");
		        for (var h = 1, g = a.length; h < g; h++) f += s(a[h] * w) + (h != g - 1 ? "," : d);
		        o.push(f)
		    }
		    return o.join(p)
		},
		T = function (t, n, r) {
		    var i = e.matrix();
		    return i.rotate(-t, .5, .5), {
		        dx: i.x(n, r),
		        dy: i.y(n, r)
		    }
		},
		N = function (e, t, n, r, i, s) {
		    var o = e._,
				u = e.matrix,
				l = o.fillpos,
				c = e.node,
				h = c.style,
				d = 1,
				v = "",
				m, g = w / t,
				y = w / n;
		    h.visibility = "hidden";
		    if (!t || !n) return;
		    c.coordsize = a(g) + p + a(y), h.rotation = s * (t * n < 0 ? -1 : 1);
		    if (s) {
		        var b = T(s, r, i);
		        r = b.dx, i = b.dy
		    }
		    t < 0 && (v += "x"), n < 0 && (v += " y") && (d = -1), h.flip = v, c.coordorigin = r * -g + p + i * -y;
		    if (l || o.fillsize) {
		        var E = c.getElementsByTagName(f);
		        E = E && E[0], c.removeChild(E), l && (b = T(s, u.x(l[0], l[1]), u.y(l[0], l[1])), E.position = b.dx * d + p + b.dy * d), o.fillsize && (E.size = o.fillsize[0] * a(t) + p + o.fillsize[1] * a(n)), c.appendChild(E)
		    }
		    h.visibility = "visible"
		};
    e.toString = function () {
        return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\u00ebl " + this.version
    };
    var C = function (e, t, r) {
        var i = n(t).toLowerCase().split("-"),
            s = r ? "end" : "start",
            o = i.length,
            u = "classic",
            a = "medium",
            f = "medium";
        while (o--) switch (i[o]) {
            case "block":
            case "classic":
            case "oval":
            case "diamond":
            case "open":
            case "none":
                u = i[o];
                break;
            case "wide":
            case "narrow":
                f = i[o];
                break;
            case "long":
            case "short":
                a = i[o]
        }
        var l = e.node.getElementsByTagName("stroke")[0];
        l[s + "arrow"] = u, l[s + "arrowlength"] = a, l[s + "arrowwidth"] = f
    },
		k = function (i, a) {
		    i.attrs = i.attrs || {};
		    var c = i.node,
				h = i.attrs,
				v = c.style,
				m, g = E[i.type] && (a.x != h.x || a.y != h.y || a.width != h.width || a.height != h.height || a.cx != h.cx || a.cy != h.cy || a.rx != h.rx || a.ry != h.ry || a.r != h.r),
				y = S[i.type] && (h.cx != a.cx || h.cy != a.cy || h.r != a.r || h.rx != a.rx || h.ry != a.ry),
				b = i;
		    for (var T in a) a[t](T) && (h[T] = a[T]);
		    g && (h.path = e._getPath[i.type](i), i._.dirty = 1), a.href && (c.href = a.href), a.title && (c.title = a.title), a.target && (c.target = a.target), a.cursor && (v.cursor = a.cursor), "blur" in a && i.blur(a.blur);
		    if (a.path && i.type == "path" || g) c.path = x(~n(h.path).toLowerCase().indexOf("r") ? e._pathToAbsolute(h.path) : h.path), i.type == "image" && (i._.fillpos = [h.x, h.y], i._.fillsize = [h.width, h.height], N(i, 1, 1, 0, 0, 0));
		    "transform" in a && i.transform(a.transform);
		    if (y) {
		        var k = +h.cx,
					A = +h.cy,
					O = +h.rx || +h.r || 0,
					_ = +h.ry || +h.r || 0;
		        c.path = e.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", s((k - O) * w), s((A - _) * w), s((k + O) * w), s((A + _) * w), s(k * w))
		    }
		    if ("clip-rect" in a) {
		        var D = n(a["clip-rect"]).split(l);
		        if (D.length == 4) {
		            D[2] = +D[2] + +D[0], D[3] = +D[3] + +D[1];
		            var P = c.clipRect || e._g.doc.createElement("div"),
						H = P.style;
		            H.clip = e.format("rect({1}px {2}px {3}px {0}px)", D), c.clipRect || (H.position = "absolute", H.top = 0, H.left = 0, H.width = i.paper.width + "px", H.height = i.paper.height + "px", c.parentNode.insertBefore(P, c), P.appendChild(c), c.clipRect = P)
		        }
		        a["clip-rect"] || c.clipRect && (c.clipRect.style.clip = "auto")
		    }
		    if (i.textpath) {
		        var B = i.textpath.style;
		        a.font && (B.font = a.font), a["font-family"] && (B.fontFamily = '"' + a["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, d) + '"'), a["font-size"] && (B.fontSize = a["font-size"]), a["font-weight"] && (B.fontWeight = a["font-weight"]), a["font-style"] && (B.fontStyle = a["font-style"])
		    }
		    "arrow-start" in a && C(b, a["arrow-start"]), "arrow-end" in a && C(b, a["arrow-end"], 1);
		    if (a.opacity != null || a["stroke-width"] != null || a.fill != null || a.src != null || a.stroke != null || a["stroke-width"] != null || a["stroke-opacity"] != null || a["fill-opacity"] != null || a["stroke-dasharray"] != null || a["stroke-miterlimit"] != null || a["stroke-linejoin"] != null || a["stroke-linecap"] != null) {
		        var j = c.getElementsByTagName(f),
					F = !1;
		        j = j && j[0], !j && (F = j = M(f)), i.type == "image" && a.src && (j.src = a.src), a.fill && (j.on = !0);
		        if (j.on == null || a.fill == "none" || a.fill === null) j.on = !1;
		        if (j.on && a.fill) {
		            var I = n(a.fill).match(e._ISURL);
		            if (I) {
		                j.parentNode == c && c.removeChild(j), j.rotate = !0, j.src = I[1], j.type = "tile";
		                var q = i.getBBox(1);
		                j.position = q.x + p + q.y, i._.fillpos = [q.x, q.y], e._preload(I[1], function () {
		                    i._.fillsize = [this.offsetWidth, this.offsetHeight]
		                })
		            } else j.color = e.getRGB(a.fill).hex, j.src = d, j.type = "solid", e.getRGB(a.fill).error && (b.type in {
		                circle: 1,
		                ellipse: 1
		            } || n(a.fill).charAt() != "r") && L(b, a.fill, j) && (h.fill = "none", h.gradient = a.fill, j.rotate = !1)
		        }
		        if ("fill-opacity" in a || "opacity" in a) {
		            var U = ((+h["fill-opacity"] + 1 || 2) - 1) * ((+h.opacity + 1 || 2) - 1) * ((+e.getRGB(a.fill).o + 1 || 2) - 1);
		            U = u(o(U, 0), 1), j.opacity = U, j.src && (j.color = "none")
		        }
		        c.appendChild(j);
		        var z = c.getElementsByTagName("stroke") && c.getElementsByTagName("stroke")[0],
					W = !1;
		        !z && (W = z = M("stroke"));
		        if (a.stroke && a.stroke != "none" || a["stroke-width"] || a["stroke-opacity"] != null || a["stroke-dasharray"] || a["stroke-miterlimit"] || a["stroke-linejoin"] || a["stroke-linecap"]) z.on = !0;
		        (a.stroke == "none" || a.stroke === null || z.on == null || a.stroke == 0 || a["stroke-width"] == 0) && (z.on = !1);
		        var X = e.getRGB(a.stroke);
		        z.on && a.stroke && (z.color = X.hex), U = ((+h["stroke-opacity"] + 1 || 2) - 1) * ((+h.opacity + 1 || 2) - 1) * ((+X.o + 1 || 2) - 1);
		        var V = (r(a["stroke-width"]) || 1) * .75;
		        U = u(o(U, 0), 1), a["stroke-width"] == null && (V = h["stroke-width"]), a["stroke-width"] && (z.weight = V), V && V < 1 && (U *= V) && (z.weight = 1), z.opacity = U, a["stroke-linejoin"] && (z.joinstyle = a["stroke-linejoin"] || "miter"), z.miterlimit = a["stroke-miterlimit"] || 8, a["stroke-linecap"] && (z.endcap = a["stroke-linecap"] == "butt" ? "flat" : a["stroke-linecap"] == "square" ? "square" : "round");
		        if (a["stroke-dasharray"]) {
		            var $ = {
		                "-": "shortdash",
		                ".": "shortdot",
		                "-.": "shortdashdot",
		                "-..": "shortdashdotdot",
		                ". ": "dot",
		                "- ": "dash",
		                "--": "longdash",
		                "- .": "dashdot",
		                "--.": "longdashdot",
		                "--..": "longdashdotdot"
		            };
		            z.dashstyle = $[t](a["stroke-dasharray"]) ? $[a["stroke-dasharray"]] : d
		        }
		        W && c.appendChild(z)
		    }
		    if (b.type == "text") {
		        b.paper.canvas.style.display = d;
		        var J = b.paper.span,
					K = 100,
					Q = h.font && h.font.match(/\d+(?:\.\d*)?(?=px)/);
		        v = J.style, h.font && (v.font = h.font), h["font-family"] && (v.fontFamily = h["font-family"]), h["font-weight"] && (v.fontWeight = h["font-weight"]), h["font-style"] && (v.fontStyle = h["font-style"]), Q = r(h["font-size"] || Q && Q[0]) || 10, v.fontSize = Q * K + "px", b.textpath.string && (J.innerHTML = n(b.textpath.string).replace(/</g, "&#60;").replace(/&/g, "&#38;").replace(/\n/g, "<br>"));
		        var G = J.getBoundingClientRect();
		        b.W = h.w = (G.right - G.left) / K, b.H = h.h = (G.bottom - G.top) / K, b.X = h.x, b.Y = h.y + b.H / 2, ("x" in a || "y" in a) && (b.path.v = e.format("m{0},{1}l{2},{1}", s(h.x * w), s(h.y * w), s(h.x * w) + 1));
		        var Y = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"];
		        for (var Z = 0, et = Y.length; Z < et; Z++) if (Y[Z] in a) {
		            b._.dirty = 1;
		            break
		        }
		        switch (h["text-anchor"]) {
		            case "start":
		                b.textpath.style["v-text-align"] = "left", b.bbx = b.W / 2;
		                break;
		            case "end":
		                b.textpath.style["v-text-align"] = "right", b.bbx = -b.W / 2;
		                break;
		            default:
		                b.textpath.style["v-text-align"] = "center", b.bbx = 0
		        }
		        b.textpath.style["v-text-kern"] = !0
		    }
		},
		L = function (t, s, o) {
		    t.attrs = t.attrs || {};
		    var u = t.attrs,
				a = Math.pow,
				f, l, c = "linear",
				h = ".5 .5";
		    t.attrs.gradient = s, s = n(s).replace(e._radial_gradient, function (e, t, n) {
		        return c = "radial", t && n && (t = r(t), n = r(n), a(t - .5, 2) + a(n - .5, 2) > .25 && (n = i.sqrt(.25 - a(t - .5, 2)) * ((n > .5) * 2 - 1) + .5), h = t + p + n), d
		    }), s = s.split(/\s*\-\s*/);
		    if (c == "linear") {
		        var v = s.shift();
		        v = -r(v);
		        if (isNaN(v)) return null
		    }
		    var m = e._parseDots(s);
		    if (!m) return null;
		    t = t.shape || t.node;
		    if (m.length) {
		        t.removeChild(o), o.on = !0, o.method = "none", o.color = m[0].color, o.color2 = m[m.length - 1].color;
		        var g = [];
		        for (var y = 0, b = m.length; y < b; y++) m[y].offset && g.push(m[y].offset + p + m[y].color);
		        o.colors = g.length ? g.join() : "0% " + o.color, c == "radial" ? (o.type = "gradientTitle", o.focus = "100%", o.focussize = "0 0", o.focusposition = h, o.angle = 0) : (o.type = "gradient", o.angle = (270 - v) % 360), t.appendChild(o)
		    }
		    return 1
		},
		A = function (t, n) {
		    this[0] = this.node = t, t.raphael = !0, this.id = e._oid++, t.raphaelid = this.id, this.X = 0, this.Y = 0, this.attrs = {}, this.paper = n, this.matrix = e.matrix(), this._ = {
		        transform: [],
		        sx: 1,
		        sy: 1,
		        dx: 0,
		        dy: 0,
		        deg: 0,
		        dirty: 1,
		        dirtyT: 1
		    }, !n.bottom && (n.bottom = this), this.prev = n.top, n.top && (n.top.next = this), n.top = this, this.next = null
		},
		O = e.el;
    A.prototype = O, O.constructor = A, O.transform = function (t) {
        if (t == null) return this._.transform;
        var r = this.paper._viewBoxShift,
			i = r ? "s" + [r.scale, r.scale] + "-1-1t" + [r.dx, r.dy] : d,
			s;
        r && (s = t = n(t).replace(/\.{3}|\u2026/g, this._.transform || d)), e._extractTransform(this, i + t);
        var o = this.matrix.clone(),
			u = this.skew,
			a = this.node,
			f, l = ~n(this.attrs.fill).indexOf("-"),
			c = !n(this.attrs.fill).indexOf("url(");
        o.translate(-0.5, -0.5);
        if (c || l || this.type == "image") {
            u.matrix = "1 0 0 1", u.offset = "0 0", f = o.split();
            if (l && f.noRotation || !f.isSimple) {
                a.style.filter = o.toFilter();
                var h = this.getBBox(),
					v = this.getBBox(1),
					m = h.x - v.x,
					g = h.y - v.y;
                a.coordorigin = m * -w + p + g * -w, N(this, 1, 1, m, g, 0)
            } else a.style.filter = d, N(this, f.scalex, f.scaley, f.dx, f.dy, f.rotate)
        } else a.style.filter = d, u.matrix = n(o), u.offset = o.offset();
        return s && (this._.transform = s), this
    }, O.rotate = function (e, t, i) {
        if (this.removed) return this;
        if (e == null) return;
        e = n(e).split(l), e.length - 1 && (t = r(e[1]), i = r(e[2])), e = r(e[0]), i == null && (t = i);
        if (t == null || i == null) {
            var s = this.getBBox(1);
            t = s.x + s.width / 2, i = s.y + s.height / 2
        }
        return this._.dirtyT = 1, this.transform(this._.transform.concat([
			["r", e, t, i]
        ])), this
    }, O.translate = function (e, t) {
        return this.removed ? this : (e = n(e).split(l), e.length - 1 && (t = r(e[1])), e = r(e[0]) || 0, t = +t || 0, this._.bbox && (this._.bbox.x += e, this._.bbox.y += t), this.transform(this._.transform.concat([
			["t", e, t]
        ])), this)
    }, O.scale = function (e, t, i, s) {
        if (this.removed) return this;
        e = n(e).split(l), e.length - 1 && (t = r(e[1]), i = r(e[2]), s = r(e[3]), isNaN(i) && (i = null), isNaN(s) && (s = null)), e = r(e[0]), t == null && (t = e), s == null && (i = s);
        if (i == null || s == null) var o = this.getBBox(1);
        return i = i == null ? o.x + o.width / 2 : i, s = s == null ? o.y + o.height / 2 : s, this.transform(this._.transform.concat([
			["s", e, t, i, s]
        ])), this._.dirtyT = 1, this
    }, O.hide = function () {
        return !this.removed && (this.node.style.display = "none"), this
    }, O.show = function () {
        return !this.removed && (this.node.style.display = d), this
    }, O._getBBox = function () {
        return this.removed ? {} : {
            x: this.X + (this.bbx || 0) - this.W / 2,
            y: this.Y - this.H,
            width: this.W,
            height: this.H
        }
    }, O.remove = function () {
        if (this.removed || !this.node.parentNode) return;
        this.paper.__set__ && this.paper.__set__.exclude(this), e.eve.unbind("raphael.*.*." + this.id), e._tear(this, this.paper), this.node.parentNode.removeChild(this.node), this.shape && this.shape.parentNode.removeChild(this.shape);
        for (var t in this) this[t] = typeof this[t] == "function" ? e._removedFactory(t) : null;
        this.removed = !0
    }, O.attr = function (n, r) {
        if (this.removed) return this;
        if (n == null) {
            var i = {};
            for (var s in this.attrs) this.attrs[t](s) && (i[s] = this.attrs[s]);
            return i.gradient && i.fill == "none" && (i.fill = i.gradient) && delete i.gradient, i.transform = this._.transform, i
        }
        if (r == null && e.is(n, "string")) {
            if (n == f && this.attrs.fill == "none" && this.attrs.gradient) return this.attrs.gradient;
            var o = n.split(l),
				u = {};
            for (var a = 0, h = o.length; a < h; a++) n = o[a], n in this.attrs ? u[n] = this.attrs[n] : e.is(this.paper.customAttributes[n], "function") ? u[n] = this.paper.customAttributes[n].def : u[n] = e._availableAttrs[n];
            return h - 1 ? u : u[o[0]]
        }
        if (this.attrs && r == null && e.is(n, "array")) {
            u = {};
            for (a = 0, h = n.length; a < h; a++) u[n[a]] = this.attr(n[a]);
            return u
        }
        var p;
        r != null && (p = {}, p[n] = r), r == null && e.is(n, "object") && (p = n);
        for (var d in p) c("raphael.attr." + d + "." + this.id, this, p[d]);
        if (p) {
            for (d in this.paper.customAttributes) if (this.paper.customAttributes[t](d) && p[t](d) && e.is(this.paper.customAttributes[d], "function")) {
                var v = this.paper.customAttributes[d].apply(this, [].concat(p[d]));
                this.attrs[d] = p[d];
                for (var m in v) v[t](m) && (p[m] = v[m])
            }
            p.text && this.type == "text" && (this.textpath.string = p.text), k(this, p)
        }
        return this
    }, O.toFront = function () {
        return !this.removed && this.node.parentNode.appendChild(this.node), this.paper && this.paper.top != this && e._tofront(this, this.paper), this
    }, O.toBack = function () {
        return this.removed ? this : (this.node.parentNode.firstChild != this.node && (this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild), e._toback(this, this.paper)), this)
    }, O.insertAfter = function (t) {
        return this.removed ? this : (t.constructor == e.st.constructor && (t = t[t.length - 1]), t.node.nextSibling ? t.node.parentNode.insertBefore(this.node, t.node.nextSibling) : t.node.parentNode.appendChild(this.node), e._insertafter(this, t, this.paper), this)
    }, O.insertBefore = function (t) {
        return this.removed ? this : (t.constructor == e.st.constructor && (t = t[0]), t.node.parentNode.insertBefore(this.node, t.node), e._insertbefore(this, t, this.paper), this)
    }, O.blur = function (t) {
        var n = this.node.runtimeStyle,
			r = n.filter;
        r = r.replace(g, d), +t !== 0 ? (this.attrs.blur = t, n.filter = r + p + h + ".Blur(pixelradius=" + (+t || 1.5) + ")", n.margin = e.format("-{0}px 0 0 -{0}px", s(+t || 1.5))) : (n.filter = r, n.margin = 0, delete this.attrs.blur)
    }, e._engine.path = function (e, t) {
        var n = M("shape");
        n.style.cssText = b, n.coordsize = w + p + w, n.coordorigin = t.coordorigin;
        var r = new A(n, t),
			i = {
			    fill: "none",
			    stroke: "#000"
			};
        e && (i.path = e), r.type = "path", r.path = [], r.Path = d, k(r, i), t.canvas.appendChild(n);
        var s = M("skew");
        return s.on = !0, n.appendChild(s), r.skew = s, r.transform(d), r
    }, e._engine.rect = function (t, n, r, i, s, o) {
        var u = e._rectPath(n, r, i, s, o),
			a = t.path(u),
			f = a.attrs;
        return a.X = f.x = n, a.Y = f.y = r, a.W = f.width = i, a.H = f.height = s, f.r = o, f.path = u, a.type = "rect", a
    }, e._engine.ellipse = function (e, t, n, r, i) {
        var s = e.path(),
			o = s.attrs;
        return s.X = t - r, s.Y = n - i, s.W = r * 2, s.H = i * 2, s.type = "ellipse", k(s, {
            cx: t,
            cy: n,
            rx: r,
            ry: i
        }), s
    }, e._engine.circle = function (e, t, n, r) {
        var i = e.path(),
			s = i.attrs;
        return i.X = t - r, i.Y = n - r, i.W = i.H = r * 2, i.type = "circle", k(i, {
            cx: t,
            cy: n,
            r: r
        }), i
    }, e._engine.image = function (t, n, r, i, s, o) {
        var u = e._rectPath(r, i, s, o),
			a = t.path(u).attr({
			    stroke: "none"
			}),
			l = a.attrs,
			c = a.node,
			h = c.getElementsByTagName(f)[0];
        return l.src = n, a.X = l.x = r, a.Y = l.y = i, a.W = l.width = s, a.H = l.height = o, l.path = u, a.type = "image", h.parentNode == c && c.removeChild(h), h.rotate = !0, h.src = n, h.type = "tile", a._.fillpos = [r, i], a._.fillsize = [s, o], c.appendChild(h), N(a, 1, 1, 0, 0, 0), a
    }, e._engine.text = function (t, r, i, o) {
        var u = M("shape"),
			a = M("path"),
			f = M("textpath");
        r = r || 0, i = i || 0, o = o || "", a.v = e.format("m{0},{1}l{2},{1}", s(r * w), s(i * w), s(r * w) + 1), a.textpathok = !0, f.string = n(o), f.on = !0, u.style.cssText = b, u.coordsize = w + p + w, u.coordorigin = "0 0";
        var l = new A(u, t),
			c = {
			    fill: "#000",
			    stroke: "none",
			    font: e._availableAttrs.font,
			    text: o
			};
        l.shape = u, l.path = a, l.textpath = f, l.type = "text", l.attrs.text = n(o), l.attrs.x = r, l.attrs.y = i, l.attrs.w = 1, l.attrs.h = 1, k(l, c), u.appendChild(f), u.appendChild(a), t.canvas.appendChild(u);
        var h = M("skew");
        return h.on = !0, u.appendChild(h), l.skew = h, l.transform(d), l
    }, e._engine.setSize = function (t, n) {
        var r = this.canvas.style;
        return this.width = t, this.height = n, t == +t && (t += "px"), n == +n && (n += "px"), r.width = t, r.height = n, r.clip = "rect(0 " + t + " " + n + " 0)", this._viewBox && e._engine.setViewBox.apply(this, this._viewBox), this
    }, e._engine.setViewBox = function (t, n, r, i, s) {
        e.eve("raphael.setViewBox", this, this._viewBox, [t, n, r, i, s]);
        var u = this.width,
			a = this.height,
			f = 1 / o(r / u, i / a),
			l, c;
        return s && (l = a / i, c = u / r, r * l < u && (t -= (u - r * l) / 2 / l), i * c < a && (n -= (a - i * c) / 2 / c)), this._viewBox = [t, n, r, i, !!s], this._viewBoxShift = {
            dx: -t,
            dy: -n,
            scale: f
        }, this.forEach(function (e) {
            e.transform("...")
        }), this
    };
    var M;
    e._engine.initWin = function (e) {
        var t = e.document;
        t.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
        try {
            !t.namespaces.rvml && t.namespaces.add("rvml", "urn:schemas-microsoft-com:vml"), M = function (e) {
                return t.createElement("<rvml:" + e + ' class="rvml">')
            }
        } catch (n) {
            M = function (e) {
                return t.createElement("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')
            }
        }
    }, e._engine.initWin(e._g.win), e._engine.create = function () {
        var t = e._getContainer.apply(0, arguments),
			n = t.container,
			r = t.height,
			i, s = t.width,
			o = t.x,
			u = t.y;
        if (!n) throw new Error("VML container not found.");
        var a = new e._Paper,
			f = a.canvas = e._g.doc.createElement("div"),
			l = f.style;
        return o = o || 0, u = u || 0, s = s || 512, r = r || 342, a.width = s, a.height = r, s == +s && (s += "px"), r == +r && (r += "px"), a.coordsize = w * 1e3 + p + w * 1e3, a.coordorigin = "0 0", a.span = e._g.doc.createElement("span"), a.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;", f.appendChild(a.span), l.cssText = e.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", s, r), n == 1 ? (e._g.doc.body.appendChild(f), l.left = o + "px", l.top = u + "px", l.position = "absolute") : n.firstChild ? n.insertBefore(f, n.firstChild) : n.appendChild(f), a.renderfix = function () { }, a
    }, e.prototype.clear = function () {
        e.eve("raphael.clear", this), this.canvas.innerHTML = d, this.span = e._g.doc.createElement("span"), this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;", this.canvas.appendChild(this.span), this.bottom = this.top = null
    }, e.prototype.remove = function () {
        e.eve("raphael.remove", this), this.canvas.parentNode.removeChild(this.canvas);
        for (var t in this) this[t] = typeof this[t] == "function" ? e._removedFactory(t) : null;
        return !0
    };
    var _ = e.st;
    for (var D in O) O[t](D) && !_[t](D) && (_[D] = function (e) {
        return function () {
            var t = arguments;
            return this.forEach(function (n) {
                n[e].apply(n, t)
            })
        }
    }(D))
}(window.Raphael);
(function (e) {
    "use strict";
    var t = e.jQuery,
		n = e.qh360cp,
		r = e._,
		i = {},
		s = {},
		o = {
		    ".ball_1": "#1489ec",
		    ".ball_2": "#008722",
		    ".ball_3": "#ff8700",
		    ".ball_4": "#683535",
		    ".ball_5": "#cc0000",
		    ".ball_6": "#b100ef",
		    ".ball_7": "#00dbd9",
		    ".ball_8": "#698353",
		    ".ball_9": "#b20000",
		    ".ball_10": "#5206c1",
		    ".ball_13": "#00dbd9",
		    ".ball_14": "#1e88ee",
		    ".ball_15": "#009e38",
		    ".ball_16": "#f700d5",
		    ".ball_17": "#f86300",
		    ".ball_18": "#ff9c02",
		    ".ball_19": "#2a527f",
		    ".bg_1": "#f86300",
		    ".bg_2": "#f700d5",
		    ".bg_3": "#ea180d",
		    ".bg_4": "#009E38",
		    ".bg_5": "#1e88ee",
		    ".bg_6": "#06c18e",
		    ".bg_7": "#2a527f",
		    ".bg_8": "#ff9c02",
		    ".bg_9": "#5206c1",
		    ".bg_10": "#1489ec",
		    ".bg_11": "#008722",
		    ".bg_12": "#ff8700",
		    ".bg_13": "#5206c1",
		    ".bg_14": "#683535",
		    ".bg_15": "#cc0000",
		    ".bg_16": "#698353",
		    ".bg_17": "#FFDDC4",
		    ".bg_18": "#C2D5FE",
		    ".egcolor_1": "#2E6DC6",
		    ".egcolor_3": "#2E6DC6",
		    ".egcolor_5": "#2E6DC6",
		    ".egcolor_2": "#ff0000",
		    ".egcolor_4": "purple",
		    ".ybg_2": "#E0F7E2",
		    ".ball_s3": "#cc0000",
		    ".ball_s2": "#ff8700",
		    ".ball_s1": "#008722",
		    ".ball_s4": "#00dbd9",
		    ".ball_s5": "#698353",
		    ".ball_s6": "#b20000",
		    ".ball_s7": "#ea180d",
		    ".ball_s8": "#f700d5",
		    ".ball_s11": "#683535",
		    ".ball_s19": "#2A527F"
		};
    i.zstLine = function (e) {
        var n = e.dstID,
			r = t("#" + n).parent();
        t("#" + n).empty();
        var i, s = 1,
			u, a = {},
			f = {},
			l = 0,
			c = {
			    x: 20,
			    y: 21
			},
			h = 0,
			p, d = r.offset(),
			v = "",
			m = {},
			g = {},
			y = e.offset || {
			    left: 0,
			    top: 0
			},
			b = {
			    left: d.left + y.left,
			    top: d.top + y.top
			};
        for (var w in e.config) i = r.find(w), u = e.config[w], s = u.length, p = i.eq(0), c.x = p.width() / 2, c.y = p.height() / 2, i.each(function (e, n) {
            h = e % s, a = t(n).offset(), f = i.eq(e + s).offset(), f && (l = Math.atan((f.left - a.left) / (f.top - a.top)), m.x = a.left + c.x + c.y * Math.sin(l) - b.left, m.y = a.top + c.y + c.y * Math.cos(l) - b.top, g.x = f.left + c.x - c.y * Math.sin(l) - b.left, g.y = f.top + c.y - c.y * Math.cos(l) - b.top, v = ["M" + m.x, m.y, "L" + g.x, g.y].join(","), u[h].push(v))
        });
        var E = Raphael(n, r.width() - y.left, r.height() - y.top - r.find("table:eq(0) tfoot").height());
        Raphael.svg && t("#" + n + ">svg").css({
            left: 0,
            top: 0
        }), t("#" + n).css({
            left: y.left,
            top: y.top
        }), E.clear();
        var S = o;
        if (!e.filter) for (w in e.config) {
            u = e.config[w];
            for (var x = 0, T = u.length; x < T; x++) E.path(u[x].join(",")).attr({
                stroke: S[w],
                "stroke-width": 2,
                "stroke-linecap": "round",
                "stroke-linejoin": "round"
            })
        } else {
            var N = [];
            for (w in e.config) {
                u = e.config[w], N = e.filter[w] || [];
                for (var x = 0, T = u.length; x < T; x++) {
                    if (t.inArray(x, N) > -1) continue;
                    E.path(u[x].join(",")).attr({
                        stroke: S[w],
                        "stroke-width": 2,
                        "stroke-linecap": "round",
                        "stroke-linejoin": "round"
                    })
                }
            }
        }
    };
    var u = function (e) {
        var n = e.posArr,
            r = [],
            i = e.$sel,
            s = e.cName;
        return e.on ? i.each(function (e, i) {
            e == n[0] && (r.push(n.shift()), t(i).addClass(s))
        }) : i.each(function (e, i) {
            e == n[0] && (r.push(n.shift()), t(i).removeClass(s))
        }), r
    },
		a = function (e) {
		    var n = t(e.numSel),
				r = s.numArr || [];
		    if (r.length < 1) {
		        var i = e.sort;
		        i ? n.each(function (n, s) {
		            r.push(t(s).text().split(e.numSep).sort(function (e, t) {
		                return (e - t) * i
		            }))
		        }) : n.each(function (n, i) {
		            r.push(t(i).text().split(e.numSep))
		        }), s.numArr = r
		    }
		};
    s.lhHandle = function (e) {
        var n = s.numArr || [];
        n.length || (e.sort ? a({
            numSel: e.sel,
            numSep: e.numSep,
            repeat: e.repeat,
            sort: e.sort
        }) : a({
            numSel: e.sel,
            numSep: e.numSep,
            repeat: e.repeat
        })), $src = t(e.numSel);
        var r = s.lh || [];
        if (r.length) {
            var i = {
                $sel: $src,
                posArr: r,
                cName: e.cName,
                on: e.on
            };
            return s.lh = u(i), !0
        }
        var o = e.numSpace,
			f = [],
			l = 0,
			c = s.numArr;
        if (e.repeat) {
            for (var h = 1, p = c[0].length; h < p; h++) c[0][h] != c[0][h - 1] && (l += 1);
            for (var d = 1, v = c.length; d < v; d++) for (h = 0, p = c[d].length; h < p; h++) h ? c[d][h] != c[d][h - 1] && (l += 1, (t.inArray(o[c[d][h] - 1], c[d - 1]) > -1 || t.inArray(o[c[d][h] * 1 + 1], c[d - 1]) > -1) && f.push(l)) : (l += 1, t.inArray(o[c[d][h] * 1 + 1], c[d - 1]) > -1 && f.push(l))
        } else for (var d = 1, c = s.numArr, v = c.length, p = c[0].length; d < v; d++) {
            l = d * p;
            for (var h = 0; h < p; h++) (t.inArray(o[c[d][h] - 1], c[d - 1]) > -1 || t.inArray(o[c[d][h] * 1 + 1], c[d - 1]) > -1) && f.push(l + h)
        }
        if (f.length) {
            var i = {
                $sel: $src,
                posArr: f,
                cName: e.cName,
                on: e.on
            };
            return s.lh = u(i), !0
        }
    }, s.chHandle = function (e) {
        var n = s.numArr || [];
        n.length || (e.sort ? a({
            numSel: e.sel,
            numSep: e.numSep,
            repeat: e.repeat,
            sort: e.sort
        }) : a({
            numSel: e.sel,
            numSep: e.numSep,
            repeat: e.repeat
        })), $src = t(e.numSel);
        var r = s.ch || [];
        if (r.length) {
            var i = {
                $sel: $src,
                posArr: r,
                cName: e.cName,
                on: e.on
            };
            return s.ch = u(i), !0
        }
        var o = [],
			f = 0,
			l = s.numArr;
        if (e.repeat) {
            for (var c = 1, h = l[0].length; c < h; c++) l[0][c] != l[0][c - 1] && (f += 1);
            for (var p = 1, d = l.length; p < d; p++) for (c = 0, h = l[p].length; c < h; c++) c ? l[p][c] != l[p][c - 1] && (f += 1, t.inArray(l[p][c], l[p - 1]) > -1 && o.push(f)) : (f += 1, t.inArray(l[p][c], l[p - 1]) > -1 && o.push(f))
        } else for (var p = 1, l = s.numArr, d = l.length, h = l[0].length; p < d; p++) {
            f = p * h;
            for (var c = 0, h = l[p].length; c < h; c++) t.inArray(l[p][c], l[p - 1]) > -1 && o.push(f + c)
        }
        if (o.length) {
            var i = {
                $sel: $src,
                posArr: o,
                cName: e.cName,
                on: e.on
            };
            return s.ch = u(i), !0
        }
    }, s.lxHandle = function (e) {
        var n = s.numArr || [];
        n.length || (e.sort ? a({
            numSel: e.sel,
            numSep: e.numSep,
            repeat: e.repeat,
            sort: e.sort
        }) : a({
            numSel: e.sel,
            numSep: e.numSep,
            repeat: e.repeat
        })), $src = t(e.numSel);
        var r = s.lx || [];
        if (r.length) {
            var i = {
                $sel: $src,
                posArr: r,
                cName: e.cName,
                on: e.on
            };
            return s.lx = u(i), !0
        }
        var o = e.numSpace,
			f = [],
			l = -1,
			c = s.numArr;
        if (e.repeat) for (var h = 0, p = c.length; h < p; h++) for (v = 0, d = c[h].length; v < d; v++) v ? c[h][v] != c[h][v - 1] && (l += 1, (o[c[h][v] - 1] == c[h][v - 1] || o[c[h][v] * 1 + 1] == c[h][v + 1]) && f.push(l)) : (l += 1, o[c[h][v] * 1 + 1] == c[h][v + 1] && f.push(l));
        else for (var h = 0, c = s.numArr, p = c.length, d = c[0].length; h < p; h++) {
            l = h * d;
            for (var v = 0; v < d; v++) (o[c[h][v] - 1] == c[h][v - 1] || o[c[h][v] * 1 + 1] == c[h][v + 1]) && f.push(l + v)
        }
        if (f.length) {
            var i = {
                $sel: $src,
                posArr: f,
                cName: e.cName,
                on: e.on
            };
            return s.lx = u(i), !0
        }
    }, s.ylfcHandle = function (e) {
        var n = document.getElementById(e.id),
			r = n.rows,
			i = r.length - 1,
			s = r[i].cells,
			o = s.length,
			u = e.cName,
			a = "",
			f = e.rowSpan || 0,
			l = e.flag,
			c = e.sel,
			h = {},
			p = 0;
        if (e.on) if (f > 0) {
            for (var d = 0, v; d < o; d++) {
                if (!(t.inArray(s[d].className.split(" ")[0], c) > -1)) continue;
                v = i, p = 0;
                while (v > -1 && r[v].cells[d].getAttribute(l) == null) {
                    v--;
                    while (v > 0 && r[v].cells.length != o) v--;
                    p++
                }
                h[d] = [p, v]
            }
            var m, u;
            for (var g in h) {
                m = h[g][1], u = h[g][0] < 6 ? "ysep_5" : h[g][0] < 12 ? "ysep_6" : "ysep_12";
                for (var v = i; v > m; v--) {
                    if (r[v].cells.length != o) continue;
                    r[v].cells[g].className += " " + u
                }
            }
        } else {
            for (var d = 0; d < o; d++) {
                if (!(t.inArray(s[d].className.split(" ")[0], c) > -1)) continue;
                v = i;
                while (v > -1 && r[v].cells[d].getAttribute(l) == null) v--, p++;
                h[d] = [p, v]
            }
            var m, u;
            for (var g in h) {
                m = h[g][1], u = h[g][0] < 6 ? "ysep_5" : h[g][0] < 12 ? "ysep_6" : "ysep_12";
                for (var v = i; v > m; v--) r[v].cells[g].className += " " + u
            }
        } else t(".ysep_5").removeClass("ysep_5"), t(".ysep_6").removeClass("ysep_6"), t(".ysep_12").removeClass("ysep_12")
    }, n.pages.draw = i, n.pages.control = s
})(window);
(function () {
    "use strict";
    var e = window.jQuery,
		t = window.qh360cp,
		n = window._;
    t.pages.ds = {}, t.pages.ds.is_up = !1, t.pages.ds.up_play = ["", ""], t.pages.ds.filename = "", t.pages.ds.init = function () {
        e.extend(t.pages, window.lott_info);
        var n = e(".plays input:visible:checked");
        n.attr("codetips") && e(".ds_code_tips:visible").html(n.attr("codetips")), t.pages.ds_pre_max_count && (e(".mod-upload-dis em").eq(0).text(t.pages.ds_pre_time / 60), e(".mod-upload-dis em").eq(1).text(t.pages.ds_pre_max_count)), e("#ds_post").on("click", function (n) {
            n.preventDefault();
            var r = e("#ds_file").val().replace(/^.+\.(\w+)$/g, "$1");
            r = r.toLowerCase();
            if (r != "txt") t.lightbox.alert({
                content: "\u8bf7\u5148\u9009\u62e9\u6587\u4ef6\uff08\u4ee5.txt \u7ed3\u5c3e\u7684\u6587\u672c\u6587\u4ef6\uff09"
            });
            else {
                var i = t.pages.endtime - t.pages.countdown_sale.server_time_count / 1e3,
					s = t.pages.ds_pre_time / 60;
                if (i < t.pages.ds_pre_time && i > 0 && t.pages.ds_pre_time > 0 && s < 60) {
                    var o = s < 1 ? t.pages.ds_pre_time + "\u79d2" : s + "\u5206\u949f",
						u = '\u8bf7\u786e\u8ba4\u60a8\u4e0a\u4f20\u7684\u6ce8\u6570\u4f4e\u4e8e <em class="red">' + t.pages.ds_pre_max_count + "</em> \u6ce8",
						a = '<em class="gray">\u8bf4\u660e\uff1a\u7f51\u7ad9\u9500\u552e\u622a\u6b62\u524d ' + o;
                    a += " \u5185\uff0c\u4e0a\u4f20\u6ce8\u6570\u4ec5\u9650\u4e8e " + t.pages.ds_pre_max_count + " \u6ce8\u4ee5\u5185\uff0c\u5426\u5219\u65e0\u6cd5\u4e0a\u4f20\uff01</em>", t.lightbox.confirm({
                        content_title: u,
                        content: a,
                        confirm_title: "\u7ee7\u7eed\u4e0a\u4f20",
                        confirm_a: '<a href="#" class="lightbox_cancel"> \u53d6\u6d88</a>',
                        confirm_callback: function () {
                            t.pages.ds.submit()
                        }
                    })
                } else t.pages.ds.is_up ? t.lightbox.confirm({
                    content_title: "\u662f\u5426\u518d\u6b21\u4e0a\u4f20\u65b9\u6848\uff1f",
                    content: "\u60a8\u5df2\u6210\u529f\u4e0a\u4f20\u53f7\u7801\uff0c\u518d\u6b21\u4e0a\u4f20\u5c06\u8986\u76d6\u73b0\u6709\u53f7\u7801\uff0c\u786e\u5b9a\u4e0a\u4f20\u5417\uff1f",
                    confirm_title: "\u786e\u8ba4\u4e0a\u4f20",
                    confirm_a: '<a href="#" class="lightbox_cancel"> \u53d6\u6d88</a>',
                    confirm_callback: function () {
                        t.pages.ds.submit()
                    }
                }) : t.pages.ds.submit()
            }
        }), e("#ds_clear").on("click", function (n) {
            n.preventDefault(), e("#ds_form")[0].reset(), t.pages.ds.is_up = !1, t.pages.ds.filename = "", e("#ds_info").html(""), e("#count").text("0"), e("#money").text("0"), e("#mul").val("1").trigger("blur")
        })
    }, t.pages.ds.submit = function () {
        var n = t.pages.get_plays();
        e("#PlayID").val(n[0]), t.lightbox.loading("\u6587\u4ef6\u4e0a\u4f20\u4e2d..."), e("#ds_form").trigger("submit"), clearTimeout(t.pages.ds.tmp_timeout), t.pages.ds.tmp_timeout = setTimeout(function () {
            t.lightbox.confirm({
                content_title: "\u662f\u5426\u91cd\u65b0\u4e0a\u4f20\uff1f",
                content: "\u4e0a\u4f20\u8d85\u65f6\uff0c\u7f51\u7edc\u53ef\u80fd\u5b58\u5728\u95ee\u9898\uff0c\u662f\u5426\u91cd\u65b0\u4e0a\u4f20\uff1f",
                confirm_title: "\u91cd\u65b0\u4e0a\u4f20",
                confirm_a: '<a href="#" class="lightbox_cancel"> \u53d6\u6d88</a>',
                confirm_callback: function () {
                    t.pages.ds.submit()
                }
            })
        }, 3e5)
    }, t.pages.ds.callback = function (n) {
        var r = n.XCode * 1,
			i = [];
        if (r == 0) {
            var s = n.BetCount,
				o = n.PartCodes,
				u = o.length;
            clearTimeout(t.pages.ds.tmp_timeout), t.pages.ds.is_up = 1, t.pages.ds.up_play = t.pages.get_plays(), t.pages.ds.filename = n.FID, e("#ds_form")[0].reset(), i.push('<li><div><strong>\u4e0a\u4f20\u6210\u529f\uff01</strong>\u5171<b class="red" id="ds_count">' + s + '</b>\u6ce8 <a target="_blank" class="lnk" href="/xfile/down/?FID=' + n.FID + '">\u67e5\u770b\u5168\u90e8</a></div></li>');
            for (var a = 0; a < u; a++) i.push("<li><div>" + o[a] + "</div></li>");
            e("#count").text(s), e("#ds_info").html(i.join("")), t.lightbox.alert({
                tips_type: 1,
                content: '\u606d\u559c\u60a8\uff0c\u53f7\u7801\u4e0a\u4f20\u6210\u529f\uff0c\u5171 <b class="red">' + s + " </b>\u6ce8"
            })
        } else s = 0, i.push('<li><div><em class="red">' + n.Message + "</em></div></li>"), clearTimeout(t.pages.ds.tmp_timeout), t.pages.ds.is_up = 0, t.pages.ds.filename = "", e("#mul").val("1"), e("#ds_info").html(i.join("")), t.lightbox.alert({
            content: n.Message
        });
        e("#mul").trigger("blur")
    }, t.pages.ds.param = function () {
        var e = {
            BetCodes: "File|" + t.pages.ds.filename
        };
        return e
    }, e(function () {
        t.pages.ds.init()
    })
})();